Multiple Containers read/write access in multi-threaded environment

I'm been reading the Berkeley DB XML Transaction Processing document and have a few questions. I have a multi-threaded environment (not multi-process).
1) In the "Summary and Examples" section, there is an example of several worker threads that perform many writes to a shared container. The one container is passed to all the worker threads, rather them having their own instance of the container. In my application, I could potentially have multiple worker threads acting on the same container, is it better to provide some type of connection pool, so each thread has access to the same container? Is their a problem with each thread creating a new instance of the container and writing to that? Is their pros and cons to each approach?
2) In some specific web applications, they only require read-access and have no intention of writing to the database. If the environment was created with transactions, can these applications open the environment in read-only mode, so as to not suffer the performance penalty of using transactions? Or do they still require transaction support since other threads in other applications might be writing to it. Is it better in this case to
3) Is there any decent connection pooling framework that work well with BDB XML? If transactions are involved, it seems pretty important to always close the container once you are finished with it, which kind of defeats the purpose of pooling. I see a container somewhat analogous to a JDBC transaction, where in connection pooling these transactions remain open, but in BDB XML, it doesn't seem like this is good practice. So clarification here would be appreciated.
Thanks in advance...
Chris

Chris,
I'd be careful about trying to draw too many analogies with other sorts of systems. In many ways BDB XML is simpler -- it's just a library, no server process.
An open container is analogous to an open file handle/descriptor in your operating system. It can safely be shared by all threads within a given process. In fact, you should not create more than one -- while that works, it can just be confusing, and a source of errors (for example, if you use a different path to open the container each time, you'll have problems). So by all means share them. Most Java applications just point them in a class that is accessible to all threads.
Other objects that can, and should be shared among threads include:
Environment
XmlManager
XmlQueryExpression
Most others should not. You also mention closing your containers -- there is no reason to close your active container objects until your application needs to shut down. A long-running application will want to use db_checkpoint (or equivalent) to ensure that modified pages are flushed from the transaction log to the database files, but that's about it.
As for concurrency, you obviously need transactions for concurrent write operations. If you want concurrent read access to the same containers, they should use transactions as well. Even if you don't explicitly use transactions, locks are always taken on pages in transactional containers. You cannot open the same container transactionally and not transactionally at the same time -- bad things could happen.
Depending on your performance needs, you could using snapshot concurrency, and see how it works for you. While locking does incur some overhead, it may be acceptable.
You mention creating your own "snapshot" of a container and running read-only on that copy. That's possible to do, but you have to be careful of how you create the snapshot (following hot backup procedures). Also, if you intend to open that "new" container in the same environment or application as the old one, you need to run a program on it to change its internal identification so Berkeley DB won't think it's the same file. That is, you can't just copy a container file to a new name and just open it like it's a new container if it's still in the vicinity of the original. See the -r option for the db_load program.
Now that you are probably really confused, good luck!
Regards,
George

Similar Messages

  • Read/write access when opening or saving file

    We keep getting the message "specified file not found,
    followed by the dreaded "read/write access denied" message when we
    try to open files (whether Freehand or Illustrator files) and
    sometimes when trying to save. We've tried to delete the prefs., as
    noted in other threads, but this hasn't worked for us. We are
    running Freehand MXa on PC's running Windows XP. We are trying to
    mostly open previously created Mac files.
    Can anyone help? Thanks very much!!!!

    I've not seen Word crash when selecting a smart folder - but it doesn't 'see' what's inside either. In other words when I select a smart folder in the file selector it appears to be an empty folder. And this isn't just a Word thing - lots of programs behave this way.
    I use smart folders from the desktop. I have a folder in my Dock which contains all my smart folders. I open a smart folder from there and then double-click the document I want to open. It is a work around obviously but it works

  • How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    How do I resolve this error message? The iPhoto library is on a locked volume.  Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.

    Hi j,
    I don't know if this will work, but I'd try logging in to an admin account, going to your main library (not user library), opening it, opening Application Support, selecting iPhoto, hold down the command key and press i, click on the lock in the lower left, entering the password and making sure you have Read & Write privileges for System and Admin.

  • How do I allow users to create folders in a shared folder where we all then have read/write access to those new folders?

    I have three users who need to access a particular folder on one of our other Macs. The folder resides on the desktop of that particular Mac and it is set as "shared" with all of our accounts set to access the folder. When a user creates a new subfolder in that shared folder, the permissions are instantly set to allow the creator read/write access but the other users are only allowed read-only access. Is there a way to set the permissions so that any new folder created in that shared folder automatically gives read/write access to all accounts who are authorized access to that shared folder?

    You should be able to take the permissions you have set and "apply to enclosed items." I am trying to attach a picture of what this looks like so my apologies if it does not work.
    Highlight your folder you want and go to File>Get Info or command+I and at the bottom where it has Sharing and Permissions, click the lock button to authenticate. Click the gear and click "apply to enclosed items". See if that works.

  • How can I regain Full Read Write access on my BU Drive?

    Prior to Yosemite upgrade, I had Read Write access to my BU hard drive and now I don't !! I can't update files on my back up drive.  Help!  I tried looking through help files and I am listed as an administrator on my iMac.

    When you get info on the external drive, at the very bottom is a box you can check
    "Ignore ownership on this volume"...
    If you check that, then see if you can delete and move things around.
    If that doesn't work then try clicking on the + sign and adding you as an admin so you can Read & Write.

  • Read/write access on external drive set to none; can't see drive to change

    I was learning about profiles and permissions and set the Read/write access on my external drive to none. I wanted to protect my guests from accidentally viewing private files. I thought I was doing it for that profile only, but now I can't see the drive to change it back. I have already tried using the disk utitility and re mounting the drive, but still cannot see the drive icon on the desktop or anywhere. I know the drive is okay because I can see it in disk utility but disk utility says the read/write access is none.
    thanks for anyone that can advise me. I'm more of a PC expert, than a Mac expert.
    Gary

    Follow the instructions in this FAQ which are relevant to your situation; logging in as root is not needed.
    (18945)

  • Content Management Server-Read/Write Access

    If one is migrating to a stand alone Content Management Server, then how does one control the read/write access to this CMS for the employees of an organisation?
    Previously, the CMS was SAP Portal Based and hence the read/write access was controlled from the KM Content in the Portal.
    Is there anything else to be kept in mind  as pointers when migrating to a stand alone CMS?
    Any suggestions/ideas would be greatly helpful.
    Thanks
    Tania

    Please post your question on the CMS related forum and close this one.  Here is forum for SAP Business One Reporting & Printing.
    Thanks,
    Gordon

  • When starting Final Cut Pro 7.0.3 I am all of a sudden getting a message that says "One or more of the scratch disks don't have read/ write access" and now the app won't operate - how do I fix this so I can use Final Cut Pro?

    When starting Final Cut Pro 7.0.3 I am all of a sudden getting a message that says "One or more of the scratch disks don't have read/ write access" and now the app won't operate - how do I fix this so I can use Final Cut Pro?

    Glad you found the answer.  But something seems wrong.  FCP should be able to assign the scratch disk to your startup drive.  It's not advisable, but it should be possible.  You might want to try and figure out what's going on before what ever's going on cause other problems.

  • This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."

    This message shows up when I try to access my auxiliary iPhone library: "The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library."
    What did I do wrong?  I have been downloading all my photos into this same library since Janurary with no problems.

    What version of Mac OS X?
    Click the black Apple icon on the top left of the screen and select About This Mac. The next screen will show the information.

  • Destination u have specified does not have read/ write access- FCP 7 to Compressor problem!

    Hello everyone,
    I finally got a video finished in FCP 7, and sent it to Compressor.
    When I try to add a templete (any template, but particularly the Youtube), I get a red || Source    ! || message and when I hit the submit button I see: "The destination you have specified does not have read/ write access. Check to see if the folder is set to read-only, or check your write privileges."
    What the?
    I'm using Apple ProRes 422 files.
    I tried looking at the video files themselves, with Control + I. It looks like I have "Read & Write" access to me. I'm not sure what to do.
    I also tried looking in my preferences for Final Cut Pro stuff, and it was empty, so nothing to erase. I also repaired disk permissions with the Utility application.
    Well, thanks for any help.

    I haven't tried to save to any directory.
    As soon as I send the sequence from Final Cut to Compressor, I am prompted to drag the settings to the destination... but it won't let me submit it for the "read/ write" reasons above.
    So I never get the opportunity to save it, I just close out Compressor and go back to Final Cut Pro.
    I'm wondering if it has something to do with the scratch disk files. I converted the MOV files into ProRes files and keep them in my documents, then I just dragged and dropped them into the browser. I'm wondering if somehow this is affecting things, because I can't even find a scratch disk folder with files inside.
    I also tried to look at my Final Cut Pro preferences file, but I had no idea what I was looking at so I just left it alone.
    I really appreciate this by the way.

  • What happened to my thumbnail cache files? says they do not have read/write access.

    I was opeing Fc Studio 2, when the box popped up which said: Thumbnail cache files does not have read/write access. i pressed Ok and the program closed, so I can't fix the access. What do i do?

    Thumbnail cache files will be re-generated if you trash them, so you can simply delete them.
    A better question would be: Why is FCS reporting this?  At a minimum you should repair your permissions, and run Disk Warrior on your data drive. If the message returns, think about trashing your prefs.

  • Static methods in multi-thread environment.

    Sorry for this silly question, but I have no clue...
    If you're using classes with static methods in a application server environment, would that imply all threads use that same 'one in the jvm' method and would there be a possibility for performance loss?
    Is calling another static method from a static method a good idea in a multi-thread environment, with respect to performance? Somehow I seem to get this java.lang.NoClassDefFoundError. Any ideas? The classes are in the same package. I only get these kind of problems calling static methods from static methods in a multi-thread environmnent. The static methods are pure utility functions and of course do not use class state.
    Thanks for your help.

    Sorry for this question, wasn't thinking straight. I have the answer, won't post question on multiple forums.

  • Read/write access for mac mini server

    I am having issues that users on my network have read/write permission, but if one saves a file to the network others can't open the file until I go to the mac mini to reset and allow all users to have these permissions again.  How can I set this so that I am not going to the server anytime a user creates a new file.

    Sounds like you are not using ACLs.  When you set up your shares, there are three permission sets by default.  They are the owner, the group, and other.  These are the POSIX permissions and they do not inherit.  You need to edit your share and add at least one more permission entry.  This one will be your ACL (Access Control List).  Use a group and set the group to the permission you want, likely read/write.
    Now once this is done, you will need to propagate these permissions through the existing files.  To do this, you need to open Server.app > choose your server from the left sidebar > select the Storage tab > drill down to your shared folder > use the Gear menu to use propagate.  Then send all the ACLs through all your files.
    Unmount all shares on workstations and connect again.
    R-
    Apple Consultants Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

  • FileStream locks read & write access. How can I get around this?

    I'm progressively downloading a video from a server using URLStream and FileStream classes to download and save the data to disk. While this is happening, I would also like to begin playback of the video so the user can progressively watch while this is happening. The player uses a standard FLVPlayback (version 2.5) control to load and playback videos. Unfortuantely, FileStream creates a read & write lock on the file and nobody has thus no one else can have access to it. This is a little bezarre to me because a read lock on a download is counter-intuitive, especailly for my application. I looked around the API docs but I could not find an option where I can manually set the locking mechanism on a file. Is this at all possible in Adobe AIR?

    nef9877 wrote:
    If I deathorise aall comuters and then re-authorise only the ones I want to use would this do it?
    Yes, that's how it's done.
    Read the warning about the number of times you can do this each twelve months. It can only be done so many times per year (I forget the exact wording).

  • Why the groupware connector need Read/Write access for all mailboxes?

    Hi,
    Does anybody know the technical side of how the  Groupware connector creates activities,tasks and contacts?
    I know it's not sending them with SMTP, it's work with DCOM, 
    is it creates it directly in the recipient mailbox!?, and thats why it needs write access?
    kind regards,
    Pavel, sheynkman.

    Hi,
    Thanks for the information but i already red this note and the .doc files,
    it still not answering WHY you need this permission? to answer this question you need to know the technical side,an answers to question like how the GW put the contacts or the activities in the user's inbox(using DCOM)?
    Think about that:
    If i have BP's that is not part of my organization, no way somebody will give me administrate permissions on his mailbox.
    So if this is really true SAP Didn't think that through.

Maybe you are looking for

  • Has anybody had problems with their iphone5s not charging even tho it plugged in

    It won't work help

  • Oracle 8i db import error

    while importing oracle 8.1.7.0.0 to oracle 11g R2, i am getting following error... IMP-00017: following statement failed with ORACLE error 3249: "CREATE TABLESPACE "TOOLS" DATAFILE '/home/oradata/oracanet/tools01.dbf' SI" "ZE 10485760 AUTOEXTEND ON N

  • Connecting two iPods to computer at same time

    Question: Am I able to connect two iPods (Nano and Shuffle)to my computer at same time? I would want to do this to mainly charge the batteries to these units. My computer has a four high-speed USB connections and I would like to know if this is possi

  • Singleton class instantiated several times

    Hi all, I am trying to implement an inter-applet communication using a singleton class for registering the applets. The applets are in different frames on my browser; they are placed in the same directory and they use the same java console, so I am p

  • Split line/tone Pantone swatches of same color look different

    QUESTION: In Illustrator I need to split a Pantone color into two different swatches (line and tone). When I duplicate the swatch and rename it with an "L" in front, the color looks different (with overprint preview)! Same CMYK values – I checked. I