Can multiple threads share the same cursor in berkeley db java edition?

We use berkeley db to store our path computation results. We now have two threads which need to retrieve records from database. Specifically, the first thread accesses the database from the very beginning and read a certain number of records. Then, the second thread needs to access the database and read the rest records starting from the position where the cursor stops in the first thread. But, now, I cannot let these two threads share the same cursor. So, I have to open the database separately in two threads and use individual cursor for each thread. This means I have to in the second thread let the cursor skip the first certain number of records and then read the rest records. However, in this way, it is a waste of time letting the second thread skip a certain of records. It will be ideal for us that the second thread can start reading the record just from the place where the first thread stops. Actually, I have tried using transactional cursor and wanted to let the two threads share the same transactional cursor. But it seems that this didn't work.
Can anyone give any suggestion? Thank you so much!
sgao

If your question is really about using the BDB Java Edition product please post to the JE forum:
Berkeley DB Java Edition
If your question is about using the Java API of the BDB (C-based) product, then this is the correct forum.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Can multiple portlets share the same pageflow ?

    What is the framework behaviour if two distincts portlets are based on the same
    pageflow .jpf file.
    Will they share the classe instance or will it be two distincts page flow instances.

    Yes, multiple portlets can share the same pageflow, and the instances
    will be separate.
    Subbu
    Olivier wrote:
    What is the framework behaviour if two distincts portlets are based on the same
    pageflow .jpf file.
    Will they share the classe instance or will it be two distincts page flow instances.

  • Can multiple iPhones share the same iTunes account?

    My daughter received her first iPhone.  She activated it today using my iTunes account and all of my contacts were overwritten with her contacts. How can we fix this? My other daughter received hers today as well but she hasn't activated it yet. What can we do to prevent this from happening? Also, can multiple iPhones share one iTunes account?
    Thanks

    JustElleBea wrote:
    ... can multiple iPhones share one iTunes account?
    Yes... But anything Purchased or Downloaded is Permanently Tied to that Apple ID (yours)
    Re Using Multiple Devices on one Computer...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • How can multiple threads hold the same lock?

    I was always under the impression that no 2 threads could hold a lock for the same object, and yet the HotSpot traces say this is happening all the time.
    For example Object 0x0a6c1bf8 is locked in 2 threads:
    "10.129.24.35-1" daemon prio=6 tid=0x2836bad0 nid=0x9d4 runnable [0x2b28f000..0x2b28fc9c]
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    - locked <0x2493f6e0> (a java.net.SocksSocketImpl)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at org.jacorb.orb.factory.PortRangeSocketFactory.doCreateSocket(PortRangeSocketFactory.java:142)
    at org.jacorb.orb.factory.AbstractSocketFactory.createSocket(AbstractSocketFactory.java:54)
    at org.jacorb.orb.iiop.ClientIIOPConnection.createSocket(ClientIIOPConnection.java:313)
    at org.jacorb.orb.iiop.ClientIIOPConnection.connect(ClientIIOPConnection.java:160)
    - locked <0x0a6c1b98> (a org.jacorb.orb.iiop.ClientIIOPConnection)
    at org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:934)
    - locked <0x0a6c1bf8> (a java.lang.Object)
    at org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:900)
    at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:323)
    at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:304)
    at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1024)
    - locked <0x0d434a88> (a java.lang.Object)
    at org.jacorb.orb.Delegate.invoke(Delegate.java:939)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:80)
    at com.company.MyApp._StateChangeListenerStub.newChanges(_StateChangeListenerStub.java:33)
    at com.company.MyAppManager.ListenerOneway.send(ListenerOneway.java:65)
    at com.company.MyAppManager.Sender.run(Sender.java:139)
    "ClientMessageReceptor840" daemon prio=6 tid=0x2a3ab988 nid=0x6b4 in Object.wait() [0x2f70f000..0x2f70fb1c]
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:474)
    at org.jacorb.orb.giop.GIOPConnection.waitUntilConnected(GIOPConnection.java:278)
    - locked <0x0a6c1bf8> (a java.lang.Object)
    at org.jacorb.orb.giop.GIOPConnection.getMessage(GIOPConnection.java:318)
    at org.jacorb.orb.giop.GIOPConnection.receiveMessages(GIOPConnection.java:464)
    at org.jacorb.orb.giop.MessageReceptor.doWork(MessageReceptor.java:71)
    at org.jacorb.util.threadpool.ConsumerTie.run(ConsumerTie.java:61)
    at java.lang.Thread.run(Thread.java:595)
    Have I miss-interpreted the HotSpot stack trace?

    To summarise they are both in a synchronized block on the same mutex/Object, but one is in a wait and one isn't.
    So then it follows that if the HotSpot thread reads " - waiting on <address>" like:
    "SomeThread" daemon prio=6 tid=0x29a06658 nid=0xf28 in Object.wait() [0x2b18f000..0x2b18fa1c]
    at java.lang.Object.wait(Native Method)
    - waiting on <address> (a javax.swing.TimerQueue)
    at com.comp.SomeThread.run(TimerQueue.java:236)
    - locked <0x09539510> (a javax.swing.TimerQueue)
    at java.lang.Thread.run(Thread.java:595)
    then it means that the thread is trying to enter the synchronized block on the same mutex/Object but it can't because there is another thread in there which is running, so it is waiting on the outside of the lock instead of the inside of the lock like "ClientMessageReceptor840".
    Ok, I think I get it now. Thanks everyone for your help.

  • Can multiple devices share the same library?

    I was under the impression they could not. I had originally had iTunes installed with my 5th generation iPod. Several months back my wife got an iPhone 4. We were under the impression we had to set up a library exclusive to her device, so we did. I had to open my library when I wanted to sync to my iPod, she had to open hers to sync to her iPhone. Now I just got an iPhone 4, when I plugged it into my PC, it created a new device within the library I had set up for my iPod. I don't plan on using my iPod anymore, but I get the impression I could use both devices with the same library. Could I do the same with the 2 iPhones?
    Where I get confused is when it comes to sharing music, and the fact that we have 3 directories now (the original iTunes directory, and two iPhone directories). Currently despite having 2 libraries, all the music is stored in the original iTunes directory. When we download music in iTunes, it has been stored to the that same directory and simply added to whatever library has been open. Then we can simply add it to the other library as we please. But what happens when we download Apps and music directly to our phones...I presume when synched to the PC, they'd get stored in the directory specific to that device, and cannot be shared?
    Bottom line is I'd like all music to be available to either iPhone, but would also like to ensure it is all stored in the same directory.

    What is really strange to me is the Apple licensing. I spoke with one developer about this once and here is what he told me:
    You can authorize up to 5 computers with your iTunes store ID. Any of those 5 computers can sync an app onto any of the devices that they manage syncing for, and it is perfectly legit with Apple. Due to the Apple developer agreements, he can not do anything to prevent that in his code.
    My wife and I each have iPhone and iPod Touch devices. We each have our own iTunes store ID's (because we didn't know better at the time) so we authenticate both computers to both accounts and we can share our music & app purchases "freely" between our 4 devices. We each could authorize up to 3 more PC's with our accounts and allow more people to share our purchases (if we trust them not to purchase things using our accounts) but we don't feel that is the correct way to treat the app developers, so we don't do that. In fact, there at least one app we have liked so much, we both spent the $7.99 to purchase even though we didn't need to.

  • Can multiple users share the same DB ?

    We have about 10,000 + personal photos.  Can I install the LR Database on my server so that my wife and I can both be adding metatags to the photos at the same time ?  I don't mind if I have to buy 2 copies, but I am more concerned about sharing the database.  Any Ideas ?

    i would not advice to do it but....
    http://asaphotodigitalgearreview.blogspot.com/2011/05/2011-update-using-lightroom-across.h tml

  • Can a company share the same Digital ID?

    Hi,
    I'm trying to get to grips with how Adobe's Digital ID encryption works.
    I have a document that I send out regularly to clients that needs protecting and I believe that the pubic/private encryption key is the best thing.
    I have a question: Can a company or several computers share the same Digital ID? For example, I usually work on my main computer but occassionally if I'm travelling I have to use my laptop to send out the document etc. Can multiple computers share the same ID? If so, how do I do this? I don't want to have set everybody up on my main computer and then my laptop etc... my clients won't be happy.
    Thanks!
    -blueunderground

    Thanks for your response.
    I want to have access to my digital ID on more than one computer so I can apply certificate security. I've created a digital ID on my laptop, can I then transfer it to my main pc?
    When I said 'my clients won't be happy' I meant if I have to create a new digital ID on every device I use and then add each client (i have over 100) multipe times to each device I use.. they will get annoyed. Do you see what I'm saying?
    All i want to know is if I create a digital ID on my laptop, can I then transfer it to my main pc? if so, how do I do this?
    Thanks,

  • Can I combine multiple threads from the same contact in iMessage?

    iMessage displays multiple threads for the same contact.  Its very confusing and has resulted in lost messages.  I've tried changing a number of settings but to no avail.  Seems to require everyone in my contact list to eliminate all their email addresses in iMessage.
    Begs the question why does iMessage even need this information?  Worse, why does it suck it into its settings by default.  The directory server should only require a valid Apple ID (associated with the users' devices)  in order to direct an iMessage between two contacts.

    Thanks for the reply, appreciate your input.  I did find another way of doing it and that is to highlight the first e-mail, hold down the shift key and click on the last one.  That highlights them all and then they can all be deleted.  Your ideas also work of course and I thank you for that.  Cheers.

  • Should multiple developers share the same MDS repository?

    We are starting a new customizable application using ADF, WebCenter and SOA Suite 11g wondering what is the best practice for MDS repositories. By default JDeveloper seems to use a file-based repository, however we need to take advantage of a database repository. The question is: Can & should multiple developers share the same MDS repository, or do we need to use the RCU tool to create a new repository for each developer? If developers share the same repository I"m wondering what happens to seed customizations if two developers both edit the same thing (like a SOA composite).
    Thanks for your input

    Thanks again ... I'm not so worried about packing the customizations in the EAR or MAR, I just hate developers having to manually change adf-config.xml from source control all the time.
    I've tried using {oracle.home} and it does not work. This seems to be a bug in JDeveloper, because I print the env variable and verify that it is correct but the deployment still fails.
    In adf-config.xml I have:
    <property value="*${oracle.home}\integration*"
    name="metadata-path"/>
    When WLS starts up, I print the env variable and see it is set to: D:\home\fmw\JDEVEL~1
    But then when I try to deploy my application I get this:
    INFO: MDSException encountered in parseADFConfigurationMDS-00503: The metadata path "D:\home\fmw\jdeveloper\system11.1.1.1.33.54.07\o.j2ee\drs\PriceManagementPOC\adf\META-INF\D:\home\fmw\JDEVEL~1\integration" does not contain any valid directories.
    For some reason it seems to be appending the directory of adf-config to the oracle home directory. It's as if the code assumes its a relative path. Looks like a bug to me.
    Billy
    Edited by: Billy Turchin on Aug 28, 2009 9:33 AM

  • HT204053 Can multiple people use the same Apple ID for their own devices?

    Can multiple people use the same Apple ID for their own devices? I just set up my IPhone 4S (first time user) using the same Apple ID as my daughters and now we receive each others texts, do I need to set up my own Apple ID account?

    Yes, you can.  In fact it's recommended that you use different IDs for iMessage, FaceTime and iCloud.  You can still share the same ID for iTunes without any issues.
    You are getting each other's text messages because you're using the same ID for iMessage.  To fix this, one of you should go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign in with a different ID.  To avoid getting each other's FaceTime calls, do the same thing in Settings>FaceTime.

  • Make sure 2 threads share the same object

    I have been thinking about this for quite some time. However, I really couldn't figure it out due lack of experience and knowledge.
    I just needed to know how can I make sure that 2 or more threads (after certain checkings that they should share a same common object) will really share the same object.
    For example (to UlrikaJ if you are reading this):
    How can I achieve the following?? Thanks!
    "When James and Ada separately want to access their shared account,two transactions are started that accesses the object associated with that account number."

    Thanks for the answer. You are welcome :-)
    public class Account
       public Account getAccount(String userInput)
         // Some processes to verify the userInput go here.
         return account;
    }//End of Account class
    public UserThread implements Runnable
       private String name;
       private Semaphore s;
       private Account userAccount; //Reference for the Account class
       public UserThread(String name, Semaphore s)
          this.name = name;
          this.s = s;
       }//End of constructor
       public void run()
          for(;;)
              getUserInput(); //Ofcourse the implementation will depend on what you are doing
              s.lock(); //obtain a lock on Semaphore object
              //Entering critical section of the code
              this.userAccount = accountObject.getAccount(userInput);
              //End of critical section of the code.
              s.signal(); //Release the lock so that other thread
              //can access the getAccount() method...irrespective of the
              //variable or the object being used or referred to.
          }//End of for() loop
       }//End of run() method
    } //End of UserThread class
    public class AccountApplication
       public static void main(String args[])
          Semaphore sem = new Semaphore(0);
          //Always initialize the Semaphore with 0 when you create it.
          UserThread user1 = new UserThread("User Number 1",sem);
          UserThread user2 = new UserThread("User Number 2",sem);
          //All threads share the same Semaphore object
          Thread userThread1 = new Thread(user1);
          Thread userThread2 = new Thread(user2);
          userThread1.start();
          userThread2.start();
       }//End of main() method
    }//End of classWell, I have given the outline of the code. I have not compiled or run the program so it might have errors in its syntax.
    Obviously, you will definitely have to change it to suit your requirements. I have just shown you how to protect yur codes' critical section.
    Hope this clears your doubts.
    Vijay :-)

  • Can two people share the same Apple ID on two different iPhones and maintain different passwords?  Yes, there is more to the story.

    I have an iMac, and iPhone.  I've had my Apple ID for a few years. 
    My wife got an iPhone 4S a few months back and the salesperson at Verizon set her Apple ID the same as mine, but gave her a different password.  I don't know if this was ok, but that is what happened.
    So, yesterday, we both upgraded to IOS6 and I had no problem logging in to my iPhone with my Apple ID.  When my wife went to log in, she was told that she was entering the wrong password. We entered the password over and over again and still was wrong.
    The question is... can two people share the same Apple ID on two different iPhones and maintain different passwords?  (I have the feeling her iPhone is thinking that since it's my Apple ID, it wants my password.)
    If not, can I still set up a new Apple ID for her even through she's had the iPhone for a few months?
    Thanks.

    Hi
    You shold follow your feelings, its probably right most of the time.
    You can have 5 different devices hucked upp to one Apple ID. What I have done is that my wife and I have one Apple ID, when I bye a new app on my phone, She gets it to. Thats nice.
    You can allways set upp a new Apple ID for your wife.

  • HT204053 can two devices share the same apple id

    can two devices share the same apple id

    Yes.
    According to this Support Article  >  http://support.apple.com/kb/HT4627
    Your Apple ID can have up to 10 devices and computers (combined) associated with it.

  • How do multiple developers share the same application module

    Is there a suggested method for multiple developers to share the same application module? We have 2 developers that will have EOs in the same directory and would like to know how they can share an application module but do development on different pieces of a project.
    Thanks,
    Paula

    Try using CVS or any other source control system. Still there are some points to think about before doing big projects, because there are many files which are updated by JDEV without knowledge by the developer. This causes many conflicts using a version control system like CVS.
    If you developers both are working on the server part of the application, I suggest using multiple application modules. See this blogs:
    http://radio.weblogs.com/0118231/stories/2005/05/27/howGranularShouldMyApplicationModulesBe.html
    http://radio.weblogs.com/0118231/stories/2005/07/19/nestedApplicationModules.html
    On the client side it depends on which technology you are using (struts, swing, jsf, ...).

  • Can two people share the same library?

    I installed a new mac mini which we're planning on using as a media hub and as a machine to sync my iphone from.  I want to have a "Server" login on it just for itunes to run the backend for Apple TV.  However, I'd also like my itunes library on my "Personal" login.  Can I share the same library betwixt the two (if put into the Shared folder?) or do I have to set it up in my Personal and then share it to the Server login?  If I do that, don't I have to login to both and run itunes before it'll work?  I'd like to avoid anything like that because I travel often and want something my family can leave on and reboot easily while I'm away, without giving my kids access to my Personal login.

    Hi chris brian,
    If you are looking to share the same iTunes library between multiple user accounts on the same Mac, you may find the following article helpful:
    iTunes: How to share music between different user accounts on a single computer
    Regards,
    - Brenden

Maybe you are looking for

  • Synching with Videos App does not work correctly

    Got a couple of problems. I'm trying to get some mp4 movies onto the Videos App's library. There is a similar problem with synching the iTunes University content. I added the mp4 movies to my iTunes library, synched them eith my iPad. They show up in

  • I'm selling my ipod and need to erase all content.

    I'm selling my ipod and need to erase all content. I cannot enter the passcode to proceed because it's telling me to try again in 22433090 minutes. How can I get around this?

  • Multicam editing problems with RT

    I am having an issue in Final Cut Pro with editing with the multi-cam editor. We are us-ing a G5 Quad with 4.5 GB of Ram. We selected 4 clips from the Browser, control clicked and chose "make multiclip". Then dragged the Multiclip in to the viewer wi

  • What is this program

    hello everyone can anyone out there tell me that when i go into a music folder and a circle with a play function and you can play the whole song.Also when i access my external hard drive i can do the same thing.is this part of the software or is it i

  • HT4528 Excess amounts of data being used.

    Why is my iPhone 4 on Verizon suddenly using ridiclous amounts of data (16GB to be exact in 12 hours) when I am on wifi? Please help.