Using Berkeley With Two Different Environment Simultaneously

I am trying to use Berkeley with two different environment simultaneously in one program. But I am getting an error message of Databases left open. The first environment close with no error but the 2nd environment, having an error like this,
Exception in thread "main" java.lang.IllegalStateException: Unclosed Database: element_primary_key_index\\192.168.150.211\glassfish3\Berkeley\environment\Testing11
Unclosed Database: class_catalog\\192.168.150.211\glassfish3\Berkeley\environment\Testing11
Unclosed Database: element_database\\192.168.150.211\glassfish3\Berkeley\environment\Testing11
Databases left open: 3
     at com.sleepycat.je.Environment.close(Environment.java:383)
     at com.svi.tools.gfs3v10domain.database.GFS3v10ReadWriteDatabase.closeUpload(GFS3v10ReadWriteDatabase.java:155)
     at com.svi.tools.gfs3v10domain.GFS3v10Domain.closeReadWrite(GFS3v10Domain.java:160)
     at com.svi.tools.gfs3v10.util.GFS3v10UploadUtil.closeUpload(GFS3v10UploadUtil.java:97)
     at com.svi.tools.gfs3v10.GFS3v10.closeUpload(GFS3v10.java:115)
     at com.svi.tools.gfs3v10uploader.util.Uploader.uploadFiles(Uploader.java:89)
     at com.svi.tools.gfs3v10uploader.GFS3v10Uploader.mainMethod(GFS3v10Uploader.java:109)
     at com.svi.tools.gfs3v10uploader.GFS3v10Uploader.main(GFS3v10Uploader.java:52)
Please someone help me with my problem. Thanks in advance.

Hi Mark,
Here is my sample program for the problem:
import java.io.File;
import com.sleepycat.bind.serial.StoredClassCatalog;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseConfig;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.EnvironmentLockedException;
import com.sleepycat.je.SecondaryConfig;
import com.svi.tools.gfs3v10domain.objects.GFS3v10DomainElementData;
import com.svi.tools.gfs3v10domain.objects.GFS3v10DomainElementKey;
import com.svi.tools.gfs3v10domain.views.utils.ElementByPrimaryKeyCreator;
* Read Write Database used for every thing else.
public class MethodsSample implements GFS3v10Database {
     * Environment where the Database resides.
     private Environment environment = null;
     private boolean isClose = false;
     String environmentString;
     * Class Catalog for Stored Classes.
     private static StoredClassCatalog classCatalog;
     * Element Database.
     private static Database elementDatabase;
     * Element Database by Primary Key.
     private static Database elementByPrimaryKeyDatabase;
     private static Database catalogDatabase;
     * Default Constructor.
     public MethodsSample() {
* Alternate Constructor.
* @param homeDirectory Location where the Database is Located.
public MethodsSample(String homeDirectory) {
     environmentString = homeDirectory;
     openEnvironment(homeDirectory);
     openDatabase();
@Override
     * Opens the Read Write Database.
     * @param homeDirectory Location where the Database is Located.
public void openEnvironment(String homeDirectory) {
     EnvironmentConfig environmentConfig = new EnvironmentConfig();
environmentConfig.setTransactional(true);
environmentConfig.setAllowCreate(true);
environmentConfig.setDurability(DURABILITY);
while (environment == null) {
     try {
          environment = new Environment(new File(homeDirectory), environmentConfig);
     } catch(EnvironmentLockedException ele) {
          try {
                         Thread.sleep(500);
                    } catch (InterruptedException e) {
@Override
     * Opens the Database.
public void openDatabase() {
     DatabaseConfig databaseConfig = new DatabaseConfig();
     databaseConfig.setDeferredWrite(true);
databaseConfig.setAllowCreate(true);
catalogDatabase = environment.openDatabase(null, CLASS_CATALOG + environmentString, databaseConfig);
classCatalog = new StoredClassCatalog(catalogDatabase);
elementDatabase = environment.openDatabase(null, ELEMENT_DATABASE + environmentString, databaseConfig);
SecondaryConfig secondaryConfig = new SecondaryConfig();
secondaryConfig.setDeferredWrite(true);
secondaryConfig.setAllowCreate(true);
secondaryConfig.setSortedDuplicates(true);
secondaryConfig.setKeyCreator(new ElementByPrimaryKeyCreator(classCatalog, GFS3v10DomainElementKey.class, GFS3v10DomainElementData.class, String.class));
elementByPrimaryKeyDatabase = environment.openSecondaryDatabase(null, ELEMENT_PRIMARY_KEY_INDEX + environmentString, elementDatabase, secondaryConfig);
@Override
     * Gets the Environment.
     * @return Environment.
public Environment getEnvironment() {
     return environment;
@Override
     * Gets the Class Catalog.
     * @return Class Catalog.
public StoredClassCatalog getClassCatalog() {
     return classCatalog;
@Override
     * Gets Element Database.
     * @return Element Database.
public Database getElementDatabase() {
     return elementDatabase;
@Override
     * Gets Element By Primary Key Database.
     * @return Element By Primary Key Database.
public Database getElementByPrimaryKeyDatabase() {
     return elementByPrimaryKeyDatabase;
@Override
     * Closes Database and then Environment.
public void closeUpload() {
     System.out.println("1st Jar environment closing = " + environmentString);
     elementByPrimaryKeyDatabase.close();
     elementDatabase.close();
     classCatalog.close();
     catalogDatabase.close();
     environment.close();
     isClose = true;
public Boolean isClose() {
     return isClose;
     @Override
     public void closeOthers() {
for the Main:
public class sample {
     public static void main(String[] args) {
          String environment1 = "\\\\192.168.160.184\\glassfish\\berkeley\\environment\\home\\Multiple\\Testing11";
          String environment2 = "\\\\192.168.150.211\\glassfish3\\Berkeley\\environment\\Testing11";
          openCloseEnvironment(environment1, environment2);
     public static void openCloseEnvironment(String environment1, String environment2) {
          MethodsSample forEnvironment1 = new MethodsSample(environment1); //Opens the Databases
          MethodsSample forEnvironment2 = new MethodsSample(environment2); //Opens the Databases
          forEnvironment1.closeUpload();
          forEnvironment2.closeUpload();
// same error happens no matter what sequence for closing
Thank you.

Similar Messages

  • Using isight with two different OS

    I have a G4 running OS10.2.8 and I want to connect to my son who has a iMac G5 running 10.4. I want to buy 2x iSight cams, one for each of us, and want to know if this set up will work.
    Thanx a bunch for any help.
    Lan

    Hello Lan,
    Welcome to Apple Discussions.
    In addition to Bill's good comments, I offer the following:
    If you currently have iChat AV 2.0 for Jaguar, you will be able to chat with your son provided he meets HIS requirements and you have broadband internet service. You can be sure about which version of iChat you have by issuing the
    b iChat > About iChat
    menu command.
    The link Bill cites shows Apple's System Requirements for iChat AV 3. This would require that you upgrade your 10.2.x system to 10.4.2
    See this page for System Requirements for iChat AV 2.1. This would require that you upgrade your 10.2.x system to 10.3.9
    Mac OS X 10.2.x originally came with iChat 1.0. iChat versions earlier than v2.0 will NOT do video. If you do not already own iChat AV 2 for Jaguar, you will need to upgrade your Mac OS to get video capability.
    At one time, Apple sold an iChat AV 2.0 upgrade for the original (non-AV) Jaguar iChat, but they stopped selling (or supporting) it in October, 2004.
    My Mac OS Panther install disks include the Panther version of iChat AV 2.0. A free iChat AV 2.1 Updater is available from Apple to bring the Panther version of iChat AV to the most current
    b Panther
    version, which offers one-to-one audio and video capability. (This is an Updater ONLY. It requires iChat AV already be installed from your Panther installer disks.)
    The only way to buy iChat AV from Apple nowadays is to buy Tiger, Mac OS X 10.4.x, which includes iChat AV 3. iChat AV 3 is capable of multi-party text and audio conferencing for those who meet the System Requirements for iChat AV 3. Tiger's Mac OS X 10.4.2 Update upgrades you to the current iChat AV 3.0.1.
    If you need more info on iChat AV, see the iChat AV Frequently Asked Questions (FAQ) or the iChat AV Discussions.
    You may also be interested in the the iSight Tips and FAQ. As implied in the How To Ensure Your iSight Is Functional FAQ, new users may want to consider buying iSight at a brick and mortar store.
    Ask for a demonstration of the very same iSight you will take home. This will let you see how easy it is to connect, let you verify that it works, and give you an opportunity to ask any questions where you can
    b see
    the responses applied.
    If you have a Mac notebook, heed the magnetic mount warning in the What Mounting Hardware is available for iSight? FAQ.
    This response has grown longer that I thought, but once both you and your son are using the same Mac OS, you can eliminate all the other possibilities described above.
    As a new user, you may be interested these suggestions for Using iSight with iChat AV.
    EZ Jim

  • Using iPhoto with two different computers AND version

    I have 2 macs at my home (laptop and desktop). I have iPhoto 08 on the desktop and iPhoto 09 on my laptop. One day, I accessed my iPhoto library located on my desktop from my laptop via network sharing. I skimmed through the warning messages about the opposing iPhoto versions and was able to view my complete iPhoto library on my laptop. In the process, I now receive the "This library has been modified by a newer version of iPhoto." error on my iPhoto 08 on the desktop. How can I reverse this, so my library is 100% back to normal? It is scaring my mom who uses the desktop for photos.

    I have 2 macs at my home (laptop and desktop). I have iPhoto 08 on the desktop and iPhoto 09 on my laptop. One day, I accessed my iPhoto library located on my desktop from my laptop via network sharing. I skimmed through the warning messages about the opposing iPhoto versions and was able to view my complete iPhoto library on my laptop. In the process, I now receive the "This library has been modified by a newer version of iPhoto." error on my iPhoto 08 on the desktop.
    That is correct - that is what the warning you skimmed through and agreed to go ahead anyway was all about
    How can I reverse this, so my library is 100% back to normal?
    Load a backup
    It is scaring my mom who uses the desktop for photos.
    Nothing to be scared of - your library is safe
    but to use it you must restore a backup from before you upgraded the library
    Or purchase iLife '09 and load it (with the required OS upgrade if you are not using 10.5.6 or above on that system) on the old system.
    Or you can start over and create a new library from the original photos
    LN
    PS in the future when warned that an operation will modify something and can not be reversed it would be good to stop and fully consider what you are doing prior to proceeding

  • Using library with two different computers

    Hello, I have a macbook and an Imac, both core 2 duo. I have my Itunes library on my Imac, and I was wondering if I could share the library wirelessly with the macbook without copying the library to the macbook because I don't have the space on the hard disk.
    Thanks
    Jonathan

    if you dont care about artwork, itunes, preferences, sharing, click share my library on host machine that has all your data.....look for shared libraries on the client machine

  • I am using Windows 8 with iTunes.  How do I manage iTunes with two different Windows User Accounts?

    I have recently bought a laptop running Windows 8 and downloaded iTunes.  I subscribe to iTunes Match and have a large amount of purchased music and imported CDs, along with some films purchased from iTunes.
    I have downloaded all of the music and the films to the laptop using iTunes Match when logged in under my User Account in Windows 8.  However, when we switch to my girlfriend's User Account, she can load up iTunes but all the music and films have the cloud symbol on them indicating that they need to be downloaded
    Is is necessary to download everything to the computer twice (I can't really believe this is the answer) or are we missing something in terms of using iTunes with two different User Accounts?
    Thank you.

    Step 1
    Create a new user account on your device. For Mac users, choose “System Preferences” from the Apple Menu and navigate to the “View” menu. Click on “Accounts” and select the “+” button to add a new user account to your machine. Edit the user information and grant any relevant privileges by following the on-screen prompts.
    For Windows users, click on the Windows "Start" button, select “Control Panel” and choose “Add or Remove User Accounts.” A new window will open. Click “Create a New Account.” Name the account and set any relevant privileges by following the on-screen prompts.
    Step 2
    Sign in to the new user account you created.
    Step 3
    Open iTunes and click “Sign in.” Enter your Apple ID and password and log in.
    Step 4
    Download purchases through the iTunes store. All files related to these purchases are stored under the separate user account, thus separating both iTunes accounts and their libraries on the same computer.
    Step 5
    You can share music from both libraries by dragging your music library to a publicly accessible location on your computer. Click “Preferences” from the iTunes menu and deselect “Copy files to iTunes Media Library when adding to library file.” Add the shared folder to your library from the “File” menu.
    Tip
    Create more than one library from the same user account by deselecting “Copy files to iTunes Media Library when adding to library file” from the “Preferences” menu. Add the files you want to iTunes by dragging and dropping or by opening from the “File” menu and sync your device to that library. Quit iTunes after the sync and reopen iTunes while holding the "Shift" key in Windows or the "Option" key on a Mac.
    (tour du lịch nước ngoài)

  • HT204053 If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    Each user account may have its own Apple ID.

  • I have two different 5s's with two different phone numbers but they are both using the same iCloud/apple account. After upgrading to iOS8 when I get a phone call on one phone both phones ring.

    I have two different 5s's with two different phone numbers but they are both using the same iCloud/apple account. After upgrading to iOS8 when I get a phone call on one phone both phones ring. One phone is for work and one is for private and I don't need both phones to ring from one call. It's bizarre.......is this supposed to be like this? If so where can I turn it off?? And while we are at it iOS8 has installed iBooks on both of my phones and iTunes won't let me uninstall it. I don't need or want iBooks on my phones.

    Hi,
    There are two easy fixes to this.
    One, you can set up Family Sharing, in which you can have two different iCloud Accounts, yet still share the same apps, music, media etc.
    Two, go to Settings and turn-off "Handoff". This can be found under the General page.
    Hope this helps!

  • How do I use Home Sharing with two different apple accounts?

    How do I use Home Sharing with two different apple accounts?

    Morning Saintine,
    Thanks for using Apple Support Communities.
    Home Sharing enables you to stream or transfer music, movies, TV shows, apps, and more among up to five authorized computers in your household. To do so, you will need to Turn on Home Sharing on each computer using the same Apple ID.
    Understanding Home Sharing
    http://support.apple.com/kb/HT3819
    Hope this helps,
    Mario

  • Using a ipod with two different computers...

    I just bought a new laptop and had to download itunes again but when i hook up my ipod it tells me that that ipod is already synced with another computer (my main desktop comp.). Is there a way to use my ipod with two different computers, or can you just use one computer at a time?
    thanks!
    Dell Inspiron 1505   Windows XP  

    You can use more than one computer, but you'll have to load your iPod MANUALLY if you do, otherwise it will keep erasing things to match the library it's hooked up to.
    http://docs.info.apple.com/article.html?artnum=304711

  • Collecting data from advantech-usb4704 with two different apps at the same time

    I wonder if I can access to Advantech-4704 with two different applications at the same time?
    I use this block in my vis.
    I have enough ports, but inputs are needed in completely different applications. Do I have to close one of them or can they run simultaneously?
    Thankyou!

    Dear gtu,
    as nathand said, usually it is not supported to access the same physical resource simultaneously from multiple programs. In case of DAQmx for instance, you will get an error message which says that the resource is already reserved. I suppose the same would happen with your driver, however it might be worth a try.
    One workaround could be however if you revise your applications and merge the codes if it is possible so that no concurent resource allocation takes place.
    Best Regards,
    Adam Cseh
    Applications/Systems Engineer
    National Instruments

  • One Material with two Different In-House Production Days

    Dear Experts,
    We have 1 semi-finished material (HALB) that is common to two different locations (production version) with two different in-house Production days.  How can we separate the 2 different in- house prod. days for this specific material? Could we setup in the production version? if not, could you give us an advice.
    Ex:
    JDXZ011111 with Prod. version I000 = 3 days
    JDXZ011111 with Prod. version X000 = 1 day
    We are hoping for your help..
    Thank you.
    Regards,
    Marnelli

    Dear Mamelli,
    1.You cannot maintain  the in-house production time in the production version.
    2.In-house production time in days can be maintained in MRP2 view.
    3.If Lead time scheduling is carried out at the time of MRP run then the system uses the in-house time for the calcualtion onf basic
    start and end dates.Based on the routing data the system proposes the production start and end time.
    4.Generally exception messages 64     Production finish after order finish
    63     Production start before order start are  shown after MRP run.
    5.If basic scheduling is carried out then the system proposes only the basic dates.
    Regards
    S Mangalraj

  • How to process reports with two different date fields

    Morning all,
    This question is somewhat similar to what I asked few days back. I created two different reports for two different departments (Credit Control and Free of Charge Control).
    These two reports pull data from two different date fields and has different status check ups.
    Few days back my director requested me if he can have both reports in one report. That is when I asked question from all of you regarding two reports.
    Anyhow, that was created by implementing two sub reports however, the director asked me to combine the two different reports into one in such a way that the output records should be added up with each other hence one single report with all combined data of Credit Control and Free of Charges (not two sub reports in one report).
    The problem here which I am getting is that, both reports uses two different date fields. I can live with two different statuses as that can be easily done within formula/RT however how to create a report with Report Selection Formula condition which looks in both date fields and produces results accordingly?
    I have tried this by not putting any condition in report selection formula and ran the report, it produced total results from past 6 years.
    Any ideas how to produce combined report which has two different date fields?
    Many thanks in advance
    Regards
    Jehanzeb
    What I

    Charliy,
    No the both dates are from two different databases, tables and fields. The Credit date field is from KLAB database under max table where as the FOC date field is from SAE database under maxmast table. Klab date is under credit2 table where as foc date is under order header table.
    So its more like this:
    Klab->Max-Credit2--->Credit_date
    Sae->Maxmast->Order_header---Date entered.
    two dates totally different tables, dbs
    however, I will try your idea too and see if that works.
    Regards
    Jehanzeb

  • Set up itunes account with two different credit cards

    Is it possible to set up an existing iTunes Store Account with two different credit cards?
    I am currently registered with a personal card but wish to make one purchase for work (Lion OS) using a company credit card.
    many other sites let you choose what card to pay from, multiple addresses, etc. but I don't see any options from apple site.
    for this purchase I am considering:
    1. going into the "edit payment information".
    2. editing all the info related to the company card and address.
    3. completing the purchase and download
    4. going back to the payment info and putting back my original personal informaton.
    there must be an easier way -- or is this the only apple offering.
    any advice appeciated. TIA.

    the_0ne wrote:
    but this discussion is clearly for people that have multiple accounts because they have multiple credit cards.
    This is incorrect.
    It is very clearly for people with a single iTunes account and they want to use multiple credit cards for purchases on that single iTunes account.
    If I had one iTunes account with multiple credit cards registered (which again, is what this discussion is in reference to),
    Huh? You just wrote it was NOT that.
    I bought Lion through my company, which means I logged into the App Store with my company's credentials, of which I have my company credit card registered.
    You mean your company paid for it. You are simply the one who did the purchasing using company funds.
    I now have a new iMac of which I want to install Lion.  Apple allows you to install this same install multiple times on your own personal machines.  I had to remember which account I bought Lion on so that I logged into the App Store correctly.  If I would have logged into my new iMac with my personal account, I would have then bought Lion again, of which I didn't want to do.
    But you did not purchase Lion with your personal account. It was purchased on your business account.
    If you want Lion on your persona/home computers, you will need to purchase it.
    I also wanted to install iPhoto.  I bought iPhoto on my personal account.  I had to then log out of the app store from my company account and log back in using my personal account to install iPhoto or I would have just bought iPhoto with my company's credit card, of which I would have been in a good amount of trouble.
    Imagine if I bought 3 or 4 apps a week and these apps were scattered across my business account and my personal account.  Each time I wanted to install these apps on one of my multiple machines in my  house, I would have to remember which account I bought the app on. or go to my purchases or which there could possibly be dozens of apps in each account.
    I would hope that your company requires you to track purchases you have made with their money.
    And I would think that you would want to keep track of all business purchases so you can get reimbursed (for the purchases you made on their behalf). If/when you leave the company, they can get company owned software that you purchased with their funds.

  • How can i pay on the apple store online with two credit cards, with two different billing addresses

    I will be greatful if you could answer me this question...
    How can i pay on the apple store online with two credit cards, with two different billing addresses?
    I know that you can use two credit cards to pay an item but the problem is that i can only put the billing address of just one of the credit cards, and since the two cards are from different people (my parents) i can't do it. They live in the same place so i don't know if i should just put one of the billing address.
    Thank you.
    PS. I don't know if this is the right community to ask this, sorry if i'm wrong.

    On the Apple Store "Payment & Pricing" page it states:
    Using more than one payment card
    You can also combine payment methods to pay for your purchase. Choose from the following combinations of credit cards and Apple Gift Cards:
    Credit card(s) - up to two
    Apple Gift Card(s) - up to eight
    Apple Gift Card(s) + one credit card
    During checkout, if you are paying with a gift card issued by a credit card company, you can combine it with one credit card.

  • Can Same IDOC be sent to same Receiver with two different Message Mappings

    Hello Experts,
    Wierd doubt but want to confirm from you people.
    Scenario:
    One R/3 Sender
    SAP XI :
    One external Receiver :
    IDOC is sent from R/3 to external receiver via SAP XI.
    One interface has already been developed for the above scenario.
    Now client wants another interface to be developed for the same IDOC. Might be the values would be different for some specific fields.
    Doubt:
    Is it possible to send one similar IDOC to one target system with two different Message Interfaces?
    Ex: Created Message Interface 'A'  and correspoding Message Mapping with an IDOC
          Created Message Interface 'B' and correspoding Message Mappingwith an IDOC
    Values would be different in the IDOC and would be triggered from SAP R/3. Basing on the specific value of a field in the IDOC , can we trigger a different Message mapping for the same receiver?
    I donot see any reason in developing a new interface for the same IDOC but as per the situation mentioned above, can it be done?
    Thank you
    Alex.

    Create two interfaces for target side.
    If you want only one target interface should get data.
    You can use simple interface determination. Use the condition tab and specify the field there but the value should be constant. e.g. if field has value EN it should go to First interface and if Field has value != EN it should go to second interface.
    If you want to divide your message in to both target interfaces.
    Multimapping also can help but only if both of your target interface need idoc data.
    You can use ifexist standard node functions from UDF to choose between the field.
    For multimapping you can go to messages tab in the message mapping and can add interfaces using + sign.
    then when you see the design part you will see two messages.
    Now Start with receiver determination in ID and create one receiver determination for the sender and receiver, this shows you have only one receiver.
    In interface determination you have to choose extended and choose your mapping designed.
    then both your interfaces automatically would appear.
    Create two receiver agreements and one sender agreement.
    thanks
    hemant
    Edited by: Hemant on Aug 28, 2008 12:29 AM

Maybe you are looking for

  • Satellite P845T-107 with Win 8 PRO but after Win 8.1 update it isn't PRO

    Yesterday at Saturn Salzburg bought the notebook. It has on the bottom a PRO Windows 8 label. Unfortunately, I first initiated the update to 8.1 and then only a backup created on a USB stick. Windows has muddled up the the Pro version after Win 8.1 u

  • Ipad mini retina cannot share hot spot with Bluetooth for Iphon5

    Ipad mini retina cannot share hot spot with Bluetooth for Iphon5 But When my Iphon5 share hot spot with Bluetooth for Ipad, I can share.

  • Problem with Function Module

    Hi Friends, im calling a fm(SD_DELIVERY_UPDATE_PICKING_1) to update the picking quantity during delivery creation wn ever sto is saved,inside a badi(LE_SHP_DELIVERY_PROC).Now the controll is not comming out of the code. method IF_EX_LE_SHP_DELIVERY_P

  • Gap in standby db

    hi, backgroup: i've changed my primary db from archivelog mode to noarchivelog mode when some problem happend which cause the arch generated about 1G data within two minutes that lead to disk space used up within few hours, i've recovered the primary

  • CS4 download doesn't contain program?

    When I purchased CS4 I downloaded it to my main computer and I think my backup one too.  After a while I took it off my backup, and now I need it there again so I can travel with it.  I went into my account and downloaded it onto the backup computer.