Use java edition and native edition at same time in a single java app

Hi
I have a situation where I need to use both versions of berkeley Db at the same time. I have an external library that I use that requires the Java edition and my own code that uses the native version. Unfortunately the source code of the library is not available and I don't want to redesign my program to use the Java edition.
Some packages in je.4.0.103.jar and db.jar (version 5.1) contain the same naming structure and same classes eg. com.sleepycat.persist.EntityStore. I removed the duplicated packages in je.4.0.103.jar However it seems that the implementation is slightly different between the two version as I get
java.lang.NoSuchMethodError: com.sleepycat.persist.EntityStore.<init>(Lcom/sleepycat/je/Environment;Ljava/lang/String;Lcom/sleepycat/persist/StoreConfig;)V
When I simply had both versions available my code for the native version kept using the packages from the Java edition and the external library kept on using the native version and as a result I got loads of runtime errors.
So how do I tell them apart. The problem is because both sets of packages have identical names and class names so Java does not know which ones to use. I am using eclipse so maybe there is some option where I can tell certain classes to use certain packages.
Any ideas?

Hi,
We don't officially support using BDB and BDB JE from the same JVM process.
It's possible to work around this limitation by creating two [url http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html] Java Classloaders  that load one of the two jar files. When calling BDB or BDB JE methods, the call must be bracketed with calls like this that cause the correct classloader to be used:
ClassLoader saveLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(/* specify correct loader for BDB or BDB JE here */);
try {
   // do something with BDB or BDB JE
} finally {
  Thread.currentThread().setContextClassLoader(saveLoader);
}We are not experts on classloaders and we don't have an example of doing this. We have not done it ourselves, we only know that users have done it.
I hope this helps.
Regards,
Alex Gorrod
Oracle Berkeley DB

Similar Messages

  • Can we use both INSERT and UPDATE at the same time in JDBC Receiver

    Hi All,
    I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
    user send the file which contains both new and old record and I need to save those in MS SQL database.
    If the record exist then use UPDATE otherwise use INSERT.
    I looked on sdn but didn't find any blog which perform both the things at the same time.
    Interface Requirement
    FILE -
    > PI -
    > JDBC(INSERT & UPDATE)
    I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
    Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
    Thanks,

    Hi ,
              If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
    "If the record exist then use UPDATE otherwise use INSERT."
    Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ...  where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows  you proceed with "insert into tablename....." since there are no old records present in database.
      Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database.  A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server.   If you need further help on how to write and call stored procedure in MS SQL you can look into these links
    http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
    http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
    [ This part you can ignore, Since its not sure that you will face this situation
        Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
    http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
    http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
    http://www.faqs.org/docs/ppbook/r27479.htm
    http://msdn.microsoft.com/en-US/library/ms187373.aspx
    http://msdn.microsoft.com/en-US/library/ms173763.aspx
    http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
    http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
    http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
        There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
    regards
    Anupam

  • Can we use Badi BBP_SOURCING_BADI and BBP_DETERMINE_LOGSYS at the same time

    Hi everyone,
    We need you help. We are working in SRM 7 and ECC 6 EhP 4. We have a doubt. Can we use badis BBP_SOURCING_BADI and BBP_DETERMINE_LOGSYS at the same time in a classic scenario?
    We want to create the contract in ECC, and then we want to return the SC in SoCo in order to create the PO with the SC and the contract.
    We activate both, but the SC is not returned in SoCo.
    Thanks,
    Ivá

    Hi Ivan
    You can use both badi to change srm standard behavior.
    but one shopping cart item and it can have only one follow on document either Contract or Purchase order.
    i presumed that you want to use same sc for two purposes to create both SC and PO but it is not possible.
    for example
    shopping cart item has follow on document created  as a contract But you need to create a another shopping cart to create a Purchase order  w.r.t that contract .
    Once follow on documents are created sourcing flag will be removed .- rule
    BBP_SOURCING_BADI - you can write your custom logic and make way to cockpit .
    BBP_DETERMINE_LOGSYS - Determine your logical system.
    Muthuraman

  • Can I use both cs and cc at the same time?

    Can I use both cs and cc at the same time after upgrade to Adobe Creative Cloud?

    Yep. I have CC and CS installed and they both work. However, I don't see why I should use cs.
    Regards
    Kasper

  • Using CS commercially and privately at the same time.

    Hi all,
    If I read it correctly you are allowed to use only 1 copy at the time if you have the CS installed on 2 computers.
    I can understand completely that a double commercial use is not allowed. What if my friend wants to play a bit around with Photoshop? So only for having some fun with drawing or funny photo editing? Must I buy then 2 seperate Suites?
    Thanks!

    I think another way of looking at it is this (this isn't necessarily
    exactly what this license says, but how I look at this sort of thing).
    Most software is licensed to a single user. The "two computer" rule is
    there for the convenience of that single user NOT to EVER allow two
    peope to use it at the same time.
    This "single user" can be one person, or one of a succession of people
    not at the same time.
    For example, you could have a work computer used by shifts. I'd expect
    only one license to be needed, no matter who was working the shift.
    In this case could you install a second copy anywhere at all? I don't
    think so, because you could never know if someone was on shift using
    the other copy.
    Similarly, if a home computer is shared, it can never be right to also
    install it on a work computer.
    So - unless there are elaborate agreements about computer use time -
    the only time you can install on two computers is where they are both
    unshared, used only by a single person, ever.
    Aandi Inston

  • Has anyone used switch control and siri at the same time?

    Has anyone used accessibility switch control and siri at the same time?

    Using Xmarks and Sync simultaneously will create a mess.
    You can create a new profile, import the bookmarks from your main profile, and set up Sync for the new profile.
    The flip side is, bookmarks from your main profile would not get synced with your new profile.
    Alternatively, Xmarks is also available for Android.
    https://play.google.com/store/apps/details?id=com.xmarks.android&hl=en

  • Use one software and grab at the same time

    Hi everybody,
    I have a little problem, I`m sure it is easy to resolve but I didn`t find the solution.
    I have my first which use to open and close the gates..... But all the stuff is in a box, I can only check inside with one camera.
    I would like to be able to see inside the box with my camera to be able to open or close the gate when I have to.
    That`s my main software:
    And I would like to add the code to acquire the images.
    I know how to witte this code, but when i tried to add it. there are some problem. I can not see the picture pr use the motor.
    Anyway I don`t know how to include the acquiring software.
    Thanks you for yours solutions ^^

    Hi,
    Ok I will try to give you more information. I am not an expert so my apologize if sometimes it is not clear or complete.... 
    1. The camera is one "Point grey flea 3 usb 3.0", For the interface, all my stuff have to do with LabVIEW, so I have to acquire the video with LabVIEW.
    2. So how to explain clearly everything. Well with picture it is probably better.
    First here you will see on what I am working.
    My motor is connected with and other piece of metal (inside the white block). In this piece there are some holes. With the motor I am going to shift all this piece of metal and the holes will be just in front off the way. (There are some flies at the beginning, and when I open the gates, they are able to go in the Y.
    Then, my motor is connected to Arduino and I connected Arduino with LabVIEW. (it exist one Package)
    In this code, there is not only one motor like in the previous picture but two, because there are two side in the white plastic block.
    It is a simple code, at the beginning the doors of the piece of metal are close, when I push on "open", the motor turn, pull the peice of metal and the gates are open. and when I push on "Close behind door" or "Close front door" I can choose which one I want to close. The motor turn in the other sens and push the piece of metal to close the doors.
    In this code, everything works very well, no trouble with that.
    3. and 4. Ok think I explained almost everything.
    5. Yes I  start with one example in Find Example. the Keyword are "Arduino" and "sevo". I just modified a little, but it is approximately the same.
    6. Not really, I began with Labview two month ago, I watched a lot of video, read a lot of post in this forum, and posted a lot of question..... But Yes I should but time flies!!!!! and I`m here only four month to work.
    Anyway,  All my system is in a closed crate, and above there is one camera to see inside. So Before to close the gate, all my flies have to be in the "Y", and I can only see inside with this camera. So I would like to add in this software, one code to be able to see inside my box when i have to open and close the gate.
    I hope really it is more clear for you,
    Thanks
    Gerday M
    EDIT: By the way, probably it will be not really necessary, my boss would like to put one timer, So everything will be done automatically. But It doesn`t matter, I would like to know how to do.
    It will not be some lost time for me.

  • Using main stage and Logic Pro at same time?

    Hi all,
    Is it possible to use Mainstage to play sounds and at the same time take the sounds and with a Firewire mixer record the out of mainstage into Logic Pro? I'd like to do this internally without using an additional soundcard.
    I could use my FastTrack Pro to control the sounds in Mainstage and then use the Outputs of the FastTrack Pro to feed into the Firewire Mixer and then Record the performance in Logic Pro.
    Any ideas?
    Thanks
    Earl Green

    yep ... I do it like that all the time.
    Soundflower is your friend for piping audio out of mainstage into an audio track in Logic.
    http://cycling74.com/products/soundflower/
    To capture midi, just create an empty software instrument in logic and leave it record enabled (i.e. uncheck "open library" when creating it, and then just never select a software instrument to go on the track). This will record all the midi messages you send to mainstage.
    Granted, that only gets you so far. Playing that midi track in Logic isn't going to make any sound until you assign a software instrument to it, but it can be handy.
    A lot of times I'll record jam sessions with my band this way. Usually I'm playing pretty simple patches. 90% of the time it's just the Steinway samples, or NI B42 for organ stuff. If we do something particularly brilliant, but I flubbed the keys, I'll go into logic and manually assign whatever patch I was using in mainstage to it, then edit the midi.
    You could, in theory use something like the IAC device to route midi back OUT of Logic, into MainStage (and then capture the audio out of mainstage back into logic with soundflower). Essentially making MainStage into one big software instrument in Logic. I've never tried it, but others on this board have posted about doing this before, and I don't see why it wouldn't work.
    I really wish Apple would just setup Mainstage to work this way out of the box. It'd be an incredibly powerful tool.

  • On my wireless printer can i use both usb and wireless at the same time

    i tried to print from coupons,com but it will not  i have used coupons.com before with my other printer and weorked fine i have coupons.com looking into it
    just wondering if anyone else out there have the same problem

    Hi,
    Same physical printer but when connecting to SAME computer using both USB and wireless it becomes two (logical) printers. Probably your default prnter is the wireless one, you have to select the right printer before print .
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Using Aiport Express and internet at the same time?

    I was just wondering if anyone could offer any advice on this subject please?
    I've got a Macbook running through a wireless BT ADSL modem. I have also managed to connect the Macbook to my Aiport Express to allow me to wirelessly pipe iTunes through my stereo. I am aware that you cannot run both at once (i.e pipe music and browse the web) due to the Macbook being able to be only connected to one wireless network at a time.
    My questions is whether there is anyway round this? If I bought an Aiport Extreme base station, connected that to my wireless router and used the Airport Extreme base station for the wireless connection would I be able to add the Aiport Express to that wireless network and subsequently have the internet and the Aiport Express running on the same wireless network - hence being able to pipe the music wirelessly and also browse the web at the same time?
    Or is there another way round it?
    Any info anyone could offer would be a great help
    Thanks in advance
    James

    Ahh am I right in thinking this is the way to do it?
    http://docs.info.apple.com/article.html?artnum=302153
    Thanks
    James

  • Captivate 4 - Use the mouse and keyboard at the same time.

    Hello, good people.
    There is a way, in C4, to use the mouse and the keyboard at the same time?
    An example, in software simulation:
    "Hold the Shift key and click with the mouse in the other object to select it too..."

    Hi all
    I also understand the need for such a feature. Not saying I need it myself, but that I do understand it.
    What really needs to happen here is for everyone else that would need to use such a feature to request it from the Adobe Captivate Development team. See, the thing is, it's like a big election system. The more folks that request a specific feature, the higher it ranks on the Adobe development radar.
    So anyone that wants to see this feature should request it using the link below.
    Click here to visit the Wish Form/Bug Reporting Form
    Cheers... Rick
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Using wireless phone and PC in the same time

    Hello, my mum would like to use a classic phone handset for skype calling and in the same time to use a computer for typing skype messages. Is it possible to do this with some phone divice? I have read that phone handsets usually do not need to be connected to the computer. But she needs to have skype program on PC (to read and write messages) and call with phone. Thank you very much for advice.

    Using either a device like the Freetalk Connect Me or a Skype USB adapter allows you to utilize a standard home phone for use with Skype.  Your mother would be able to utilize the handset to talk  and at the same time continue to text chat with someone over the computer.  If she's logged onto skype on more than one computer at a time, her chat messages will still go through.  If she wants a wireless home phone to work, she would have to have the phone base station connected to one of those adapters.

  • Problem in calling Java Script and Process at the same time

    Hi Frenz,
    I have a requirement like this. when i press the button a page level process(Not Application level Process) and java script function has to happen. i wrote the Java script function to close the child window and reload the Parent window. I wrote the Process for the Parent window to get the updated screen.
    But the Process is not happening and the only the java script function is achieved.
    Can you suggest any idea to achieve both of the things at the same time?
    Thanks in Advance.....

    See this example:
    http://apex.oracle.com/pls/otn/f?p=31517:93
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Can i use Firewire 800 and 400 at the same time?

    I have a HD connected to my 800 port works fine and a GL-2 camera on the 400 and final cut pro won't see the camera. Can I have 2 devices hooked up at the same time?

    Yes. But you did not say whether the camera works alone or not at all. In the latter case it could be the camera isn't compatible.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Has anyone used Firefox Sync and Xmarks at the same time?

    Firefox is my primary desktop browser. On my desktops, I use Xmarks because I use Firefox, IE and Chrome. It enables me to keep my bookmarks synced across browsers as well as use home/work profiles, etc. However, I'd like to use Firefox Sync so I can sync the bookmarks to my smartphone. Has anyone successfully tried this? I thought I'd ask before trying it myself just in case. Thanks!

    Using Xmarks and Sync simultaneously will create a mess.
    You can create a new profile, import the bookmarks from your main profile, and set up Sync for the new profile.
    The flip side is, bookmarks from your main profile would not get synced with your new profile.
    Alternatively, Xmarks is also available for Android.
    https://play.google.com/store/apps/details?id=com.xmarks.android&hl=en

Maybe you are looking for