Db recovery in a multiprocess environment

Hi,
We have a application consisting of two tomcat servers using Berkeley db and hence the application is simultaneously accessed by two or more(I have a few utilities too) processes. I run one of these instances with primary flag and othe instance and all utilities are run as secondary instances. Only primary instance opens the environment with run_recover 'true', others dont specify this flag. While shutting down the instances, I try to close all open db handles along with environment handle for that instance.
There are following scenarios:
A) When I am shutting down the any of the tomcats, sometimes there are few open transactions and cursors. These cause some database handle close to fail and as a result, db recovery is initiated for almost every start.
My questions for scenario A) are:
1. There should be some way in which I can bring down the environment and still don't need to recover. In other words, assuming my environment has open cursors and transaction(over which I don't have any control as these are user-initiated). How do I properly close it. This question can be broken down in two parts:
a) how do i figure out or get to the open transactions and cursors.
b) then I can either wait for some time for them to complete or I can close cursors and abort/commit the transcations.
B) Sometimes one of these processes may crash, for ex: secondary tomcat going out of memory while some of the transactions are open. Can I somehow prevent the primary instance from being corrupted in the sense that it can still use the db?
Thanks and Regards,
Shishir

Hello,
From your description I believe that the "Architecting
Transactional Data Store applications" section of the documentation at:
http://www.oracle.com/technology/documentation/berkeley-db/db/ref/transapp/app.html
will provide the information you need.
If the application is organized as a group of related processes,
the order in which threads of control are created must be
controlled to serialize database environment recovery. Directly
from the documentation:
This architecture requires that threads of control be monitored.
If any thread of control exits with open Berkeley DB handles,
the application may call the DB_ENV->failchk method to detect lost
mutexes and locks and determine if the application can continue.
If the application does not call DB_ENV->failchk, or DB_ENV->failchk returns that the database environment can no longer be used,
the application must behave as if there has been a system
failure, performing recovery and creating a new database environment.
Once these actions have been taken, other threads of control can
be continued (as long as all existing Berkeley DB handles are
first discarded), or restarted.
If the application is organized as a group of unrelated processes,
some choices for monitoring them are detailed. One solution
(directly from the documentation) is to log a thread of
control ID when a new Berkeley DB handle is opened. For example,
an initial "watcher" process could run recovery on the database environment and then create a sentinel file. Any "worker" process
wanting to use the environment would check for the sentinel file.
If the sentinel file does not exist, the worker would fail or
wait for the sentinel file to be created. Once the sentinel file
exists, the worker would register its process ID with the watcher
(via shared memory, IPC or some other registry mechanism), and
then the worker would open its DB_ENV handles and proceed. When
the worker finishes using the environment, it would unregister
its process ID with the watcher. The watcher periodically checks
to ensure that no worker has failed while using the environment.
If a worker fails while using the environment, the watcher
removes the sentinel file, kills all of the workers currently
using the environment, runs recovery on the environment, and
finally creates a new sentinel file.
The documentation also describes the use of DB_REGISTER in this
case and the use of a "watcher" process.
Thanks,
Sandra

Similar Messages

  • AS Backup and Recovery Tool for HA environment

    If there I have three nodes that are running SOA suite is it necessary to back each node fully or can I backup one of the AS in full and all the other incremental?
    Are there any documents out there that describe the "Best Practice"? I have already read AS Backup Recovery tool and its strategy and it doesn't cover the HA environment backup strategy. Please advice.

    As a lot of information in various xml files is host dependent I would stick to a backup per host scheme.
    cu
    Andreas

  • Database recovery in a replication environment

    Hi everybody,
    I've configured a replication environment with Oracle 11g (Multimaster synchronous replication). Apparently it works fine, when replication is started any change in a table that belongs in a node is replicated in the rest of the nodes.
    One of the tests I'm making is the following: Try to see what happens if one of the nodes drops. Meanwhile one of the nodes is no avalaible, any modification in an avalaible node is not allowed (as I expected). I'm trying to see if the database service can be avalaible meanwhile a node is missing, although the replications is not running.
    What I've experienced is replication cannot be suspended until the the node was down is restarted.
    Is this the usual behaviour or can I set any parameters to avoid this? In other words, is it possible the database service is running meanwhile one of the nodes is down? The application I'm working on needs this type of replication, buy also needs the service is running always?
    What can I do to make possible the service is running even when a node falls?
    Thanks in advance

    Yes, I've considered an asynchronous replication, with a short period of time (it should be almost synchronous).
    I've tested that, if one of the nodes drops, database service is not available. User intervention is required to stop replication and let the system go on without replication.
    I could be a great idea that, althoug replication is not working, database service is still running and, when replication is restarted, system continue as in the beginning.
    When I test the asynchronous choice I'll answer this post.
    Best wishes,
    Payo

  • Rescue and Recovery 4.5: Boot Environment does not list Backups on USB Drive

    Hello,
    I have a fresh installed Windows 7 on a X 230 and am now setting up my backup. The notebook came without an OS so I installed Win7, all drivers and the Thinkvantage Software myself. Then I made a backup with Rescue and Recovery 4.5 to an external USB 3.0 HDD. The Backup is listed in the Windows program, but when I boot to Rescue and Recovery, the backup is not listed.
    Since there arent any options I could change during the backup or the recovery, I have no idea what went wrong..
    Thanks!

    In the standalone boot of RNR, go to the advanced GUI, chose Restore.  After a few screens, you will see a restore from location, default is Local Hard drive.  This is a drop down list.  USB option is available in the drop down list. The USB must be connected during the standalone boot. If the backup is NOT the same UUID as your system, check the box that says show backups from all systems.
    Also read my post dated Nov 22,2011 .  RNR backup reverts to local.  This may not apply to USB backups.

  • Potential bug in recovery code

    We have observed that during a normal recovery the first_lsn is set the to first version of the log file that is available. This happens even if the files have check point records (not the last but the other available files). This changes the recovery mode to "catastrophic recovery" like i.e. the recovery does a undo/redo till the last available file instead of stopping at a checkpoit lsn.
    I looked at the code in
    txn_region.c - procedure int__txn_findlastckp(env, lsnp, max_lsn)
              if ((ret = __logc_get(logc, &lsn, &dbt, DB_LAST)) != 0)
                   goto err;
              * Twiddle the last LSN so it points to the beginning of the
              * last file; we know there's no checkpoint after that, since
              * the log system already looked there.
              lsn.offset = 0;
         /* Read backwards, looking for checkpoints. */
         while ((ret = __logc_get(logc, &lsn, &dbt, DB_PREV)) == 0) {
              if (dbt.size < sizeof(u_int32_t))
                   continue;
              memcpy(&rectype, dbt.data, sizeof(u_int32_t));
              if (rectype == DB___txn_ckp) {
                   *lsnp = lsn;
                   break;
    what happes is during the reverse traversal no DB___txn_ckp record is found. It looks loke the __log_get call returns junk.
    I think setting lsn.offset to 0 creates a problem because the " logc->prev" does not correspond to this modified lsn.
    Appreciate if some one can confirm this for me.

    Thanks Sandra for reply,
    As described in this thread, my application needs to perform recovery for almost every startup.
    db recovery in a multiprocess environment
    I will patch the berkeley db. In the meantime, can i deal with this problem in following manner:
    1. Run db_checkpoint.
    2. Copy db files and MOVE unused log files along with the db files to another location.
    3. further normal recovery scenarios should not start with the first log file hence should not take as long as with all log files. Is that correct?
    In case normal recovery doesn't work, I will need to bring back copied db files alongwith moved log files and with new log files, i should be able to run catastrophic recovery.
    Can you please comment on that.
    Best Regards,
    Shishir

  • Ideas to improve the Rescue and Recovery System

    Hi,
    some weeks ago I ned to restore my system, while this process there was some difficulties with the Rescue and Recovery. But First my configuration:
    I'm using a T61p with Windows Vista Ultimate installed.
    On the System there are 5 Partitions
    1. Rescue and Recovery
    2. Windows Bootstrap
    3. BitLocker Encrypted Windows Partition
    4. Linux /boot
    5. Encrypted Linux LVM
    So, one morning I tried to start my ThinkPad and nothing worked anymore. After a Short time I found out that the boot sector of the windows bootstrap partition was corrupted. The Linux Partition worked fine and was startable with a GRUB CD-Rom.
    Ich checked out the Rescue and Recovery system and was sad that I isn't possible to recover the boot sector of the bootstrap partition. The only way to rescue my system was to reinstall windows at all!
    Thats a bad solution, because you can recover the boot sector with every OEM-DVD of Windows Vista, but this DVD is not available for a ThinkPad user.
    So I backuped my files and reinstalled the system. While the reinstallation process rescue and recovery gives the option to install windows on C:. But on such a multiboot configuration it is not very clear what drive C: is. After some experiment I think he is taking the first parition after Rescue and Recovery or the first free space after it. At this place it would be much better if I can choose a parition for the installation.
    So, if a Lenovo engineer is reading this, please think about to:
    - Include some tools like boot sector recovering in the Rescue and  Recovery system
    - Adding a mode where you can choose the parition to install Windows.
    Over and above that I'm really happy with my ThinkPad.
    Thanks for reading.

    Greetings,
    This isn't so much a reply to Cobelius, or a solution, but a commiseration of sorts.  Or at least an "I hear ya, buddy, I wish they'd improve some things about Rescue and Recovery, too."
    I notice that no one else has replied to this thread.  I hope at least that someone will read these posts, and pass 'em on to the appropriate developers.
    Here's my story:
    I am, overall, extremely happy with my brand, spanking new T500.  So far, I'm only running a single OS, Vista Business 64.
    However, I did make the following 'tweaks' to my setup, which brings out the flaws in the Rescue and Recovery software:
    1) I used Truecrypt 6.1a to encrypt my system partition (leaving the original rescue partition intact)
    (Side Note:  Where my original drive C came with tons of empty space, I used DISKPART to shrink it a bit an created another primary partition as drive D.  Hey, why the heck not?  Originally, I wanted TrueCrypt to encrypt the entire drive, but this failed.  Truecrypt said this was due to a hardware failure, but 20 hours of my life wasted scanning the drive with HDD Regenerator 1.51 revealed no bad sectors.  So now Drive D is encrypted as an ordinary TrueCrypt container and mounted upon login. I'm okay with this solution,  but if anyone wants to research why TrueCrypt couldn't do the whole disk, you have my thanks in advance.)
    2) I bought a Maxtor BlackArmor(tm) hardware-encrypted USB external drive to use for my backups.  I successfully used the Lenovo Rescue and Recovery tool to both create specific file backups as well as to image my entire drive C onto the BlackArmor device, once I mounted it (by running a built-in executable and supplying it with my secret password)
    3) I set a Lenovo BIOS password for unlocking the boot hard drive.
    So far, so good.  I type the BIOS drive password, then theTrueCrypt password, and Vista takes over 12 minutes to become usable and, well, that's a Microsoft issue, isn't it?
    But, here's the deal: WHAT IF I CAN'T BOOT FROM THE HARD DRIVE ANYMORE?  Well, TrueCrypt made me create a bootable rescue CD which can restore my encrypted boot sector or permanently decrypt my hard drive.  What it can also do is let me press the ESC key to boot without providing a password, which does a supposedly wonderful thing -- since it fails to boot my drive C, it takes me straight into the Lenovo Rescue And Recovery session.
    The problem is, the Lenovo boot (version 4) takes me AUTOMATICALLY into a self-repair utility which wastes another 10 minutes of my time to finally tell me --d'uh-- that my boot sector is 'corrupted'  (it isn't; it's merely ENCRYPTED by TrueCrypt.  As it should be).
    FLAW NUMBER 1:  Rescue and Recovery should provide a default menu where automatic diagnosis is a CHOICE the user can elect not to make, or abort if it has begun.
    FLAW NUMBER 2: You guys should enhance what appears to be a Vista PE environment (or BartPE, or whatever) with a few utilities, including an Explorer-like browser to examine the disk (which would snow nothing in my case, as my drives are encrypted),  and a command prompt, and the ability to launch executables.  The environment should also recognize USB drives.
    As it happens,  I used a third-party Vista PE rescue CD, Active@ Partition Recovery, to boot an environment having the utilities I needed.  Using this tool, I was able to recognize a USB key that had TrueCrypt installed in 'traveller' mode (no windows registry keys needed).  Running this app and providing my truecrypt password enabled me to unlock my Drive C, albeit by mounting it as another drive letter.  This made it possible to read and write to my disk.
     The encrypted Maxtor drive is visible, too, from this boot environment,  but it appears as a CD-ROM drive, and yields no secrets until you run an executable file on it and enter the drive's password. And that worked, too.  So I could find files to copy over to my hard drive, if I needed to.
    However, in order to RESTORE files to my drive, I'd still need to be able to run Rescue and Recovery, or at least the Recovery portion.  Which  brings me to:
    FUNDAMENTAL FLAW NUMBER 3:  You need to create a Recovery tool that can run from within an external USB drive, without requiring shared .DLLs in various subfolders or windows registry entries.  Lord knows, I certainly tried to copy  RestoreNow.exe from C:\Program Files (x86)\Lenovo\Rescue and Recovery onto my Maxtor drive, along with whatever DLLs it called for, but it was hopeless.  The damned thing just wouldn't run from the USB drive on the PE environment.
    The way I see it, then, is that there really is no way to restore my hard drive should I suffer a catastrophic failure.  Major bummer.
    FUNDAMENTAL FLAW NUMBER 4: When I got my laptop, I created a series of recovery disks using the Lenovo supplied software. Booting with the first CD, however, only proved depressing, as I had to agree that the ONLY purpose for this CD was to recover my PC to factory-shipped condition.  Which meant erasing my drive and restoring it with the contents of the other DVDs.  But I want to restore what I backed up with Rescue and Recovery!  My life SINCE the laptop shipped from the factory!   Geez, Louise, why not let me choose to do THAT, too?
    (Of course, the boot CD would need to allow me to execute the Maxtor program that unlocks my encrypted USB drive, and also let me execute TrueCrypt to unlock my hard drive.)
    I sure hope someone forwards this to a developer who'll take it seriously, after s/he stops chuckling.  You guys should just ship a usable Vista PE rescue CD with every laptop, I think.  And a recovery-only tool that doesn't need DLLs or Registry Entries to run. It would help in so many ways.
    In the meantime, I guess I'd better do all I can to ensure my laptop's hard drive doesn't die on me.
    Again, other than for this teeny problem that "don't amount to a hill o' beans in this crazy world," I'm really happy with my T500.
    Thanks for reading this, too.  And happy holidays.

  • Removing corrupt environment without losing database data?

    OK, I'm using Berkeley DB 4.3.28, Java API with no transactions or concurrency. We have several environments with multiple databases under them. Occasionally the environment gets corrupted. The original coder didn't understand this had to be coded for, so I'm trying to fix that.
    Normally, all database environments are opened with the following settings:
    setErrorPrefix(prefix);
    setPanicHandler(new EmsPanicHandler(prefix));
    setJoinEnvironment(true);
    I've recreated the environment corruption and used the following code to remove and recreate the environment (as suggested here: http://www.oracle.com/technology/documentation/berkeley-db/db/ref/cam/fail.html)
              EnvironmentConfig env_config = new EmsEnvironmentConfig("CleanEnvironment");
              env_config.setAllowCreate(true);
                    env_config.setErrorPrefix("string");
                    env_config.setPanicHandler(new MyPanicHandler());
              Environment m_env_handle = null;
            try {
                 File m_file = new File(environment);
                 if (!m_file.exists())
                      System.err.println("Environment "+environment+" does not exist. Skipping");
                      return;
                 System.out.println("Attempting to remove environment "+environment+" with recovery enabled");
                  //m_env_handle = new Environment(m_file, env_config);
                 Environment.remove(m_file, true, env_config);
                 System.out.println("Attempting to recreate environment");
                 m_env_handle = new Environment(m_file, env_config);
            } catch (Throwable t) {
                System.err.println("Exception trying to recover environment "+environment+": "+t.getLocalizedMessage());
            finally
                 if (m_env_handle != null)
                      System.out.println("Closing environment "+environment);
                      try {
                           m_env_handle.close();
                           System.out.println("Environment "+environment+" closed successfully");
                      catch (Exception e)
                           System.err.println("Exception trying to close environment "+environment+": "+e.getLocalizedMessage());
            }This removes and recreates the environment without giving me an error message and apparently without touching any of the underlying databases.
    Unfortunately, when I try using a database in the environment again, I can open the environment, but I get this error when trying to open the database:
    java.lang.IllegalArgumentException: Invalid argument
            at com.sleepycat.db.internal.db_javaJNI.Db_open(Native Method)
            at com.sleepycat.db.internal.Db.open(Db.java:329)
            at com.sleepycat.db.DatabaseConfig.openDatabase(DatabaseConfig.java:478)
            at com.sleepycat.db.Environment.openDatabase(Environment.java:81)
            at com.nmss.db.berkeleydb.Name_Address_Map.open(Name_Address_Map.java:358)
            at com.nmss.db.berkeleydb.Name_Address_Map.retrieveAddress(Name_Address_Map.java:296)
            at com.nmss.framework.inventory.Command.add(Command.java:269)
            at com.nmss.framework.inventory.Command.processArgs(Command.java:59)
            at com.nmss.framework.inventory.Command.<init>(Command.java:39)
            at com.nmss.framework.inventory.Command.main(Command.java:483)The Environment config is the same one I posted at the start of the message:
    setErrorPrefix(prefix);
    setPanicHandler(new MyPanicHandler(prefix));
    setJoinEnvironment(true);
    The Database config is:
    DatabaseConfig db_config = new DatabaseConfig();
    db_config.setType(DatabaseType.BTREE);
    db_config.setAllowCreate(true);
    Can anyone tell why I would be getting this error? Or does removing the environment simply invalidate any database files that were underneath it?
    db_verify used against the database returns 0.
    Thanks,
    Mike
    Message was edited by:
    msully
    Message was edited by:
    msully

    So the latest - I totally removed my old databases and rebuilt my app, with the following environment config:
            setErrorPrefix(prefix.toUpperCase());
            setPanicHandler(new EmsPanicHandler(prefix));
            setInitializeCache(true);
            setTransactional(true);
            setInitializeLogging(true);
            setInitializeLocking(true);
            setAllowCreate(true);Now I am getting the error:
    /var/tmp: no base system shared memory ID specified
    java.lang.IllegalArgumentException: Invalid argument
            at com.sleepycat.db.internal.db_javaJNI.DbEnv_open(Native Method)
            at com.sleepycat.db.internal.DbEnv.open(DbEnv.java:235)
            at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:714)
            at com.sleepycat.db.Environment.<init>(Environment.java:30)
            at com.nmss.db.berkeleydb.LogHandler.getEnvironment(LogHandler.java:226)
            at com.nmss.db.berkeleydb.LogHandler.open(LogHandler.java:197)
            at com.nmss.db.berkeleydb.LogHandler.store(LogHandler.java:235)
            at com.nmss.util.LogHandlerImpl.publish(LogHandlerImpl.java:45)
            at java.util.logging.Logger.log(Logger.java:452)
            at java.util.logging.Logger.doLog(Logger.java:474)
            at java.util.logging.Logger.logp(Logger.java:590)
            at com.nmss.util.Logger.log(Logger.java:87)
            at com.nmss.framework.inventory.Command.add(Command.java:306)
            at com.nmss.framework.inventory.Command.processArgs(Command.java:59)
            at com.nmss.framework.inventory.Command.<init>(Command.java:39)
            at com.nmss.framework.inventory.Command.main(Command.java:483)

  • Recovering Domain Controller in Exchange 2010 environment.

    Hi Friends,
    We have one windows 2008 Domain controller & one Exchange 2010 server with all role installed, My problem is if My domain controller failed , how  i can recover it?
    Is there ant step for domain controller recovery in Exchange 2010 Environment.?
    Thanks & regards,
    Pradeep

    Hi Pradeep,
    Sorry to hear that... The only option you have is to do non-authoritative restore of Active Directory...
    From Exchange prospective, once you do restore from an old backup whatever changes you made in Exchange since then won't be there as Exchange keeps all the settings in active directory, for example if you have created users then you would need to recreate
    them and attach their mailbox to back to users...
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • Guidance in Recovery Procedure

    Hi All,
    I need a little further guidance on my Grid set up, with respect to backup and recovery configuration.
    My environment:
    Microsoft Windows 2003 Standard Edition Service Pack 1
    Grid Control Release 2 (Repository DB: 10.2.0.4)
    Target DB: Both 9i and 10g (Rel.1 & 2)
    My Issue:
    I have currently confifured database backup for all the targets through the "Maintenance" tab. The backup is done directly to tape (via TDP) using RMAN. The backups are running successfully.
    I tested the recovery and am able to recover to the same server/location to where the database is without any issue..by using the "Recover Database" option.
    I also need to be able to restore the databases to a different server/location from the tape...by using the Grid Control.
    Could you folks please guide me as to how this can be done? All the DBs are in the NOARCHIVELOG mode....and the backup done is only cold backup. I backup the controlfile and parameter file as well...along with the database backup.
    The "Clone Database" option, which I did try requires the DB to be open...when in the NOARCHIVELOG mode...so I am not sure if that could be done. Hope that one of you could help me out on this......
    Thanking you all in advance.....
    Regards,
    Sriraman

    Refer: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96572/toc.htm

  • How to recover a single DB within a good environment?

    Hello,
    after an unknown crash, I have now an unusable DB. But the environment is good and can be opened without any problem. It's only when i try to open that DB that I get an error : Invalid argument.
    Of course, before the crash, everything worked well.
    So, is there a way to recover that DB?
    Note : Up to now, I do not have any backups for disaster recovery but i am still in a development process.
    I have just tested something : I tried to open and read some data from that DB without using my environment and everything worked well. So, I'm able to open it without my environment but I can't if I try to open it within my environment?
    Why and how may I solve this situation?
    Thank you
    Edited by: user606302 on Oct 1, 2008 12:07 PM

    Hello,
    Normal recovery which you are doing, examines the content
    of the environment's log files and uses this information
    to ensure that your database files are consistent relative
    to the information contained in the log files. Normal recovery
    starts with any logs used by any transactions active at the
    time of the last checkpoint, and examines all logs from then
    to the current logs. Normal recovery also recreates your
    environment's region files. This has the desired effect of
    clearing any unreleased locks that your application may have
    held at the time of an unclean application shutdown.
    You can turn on verbose error messaging as that should
    provide additional information on what is causing the
    Invalid argument error.
    For that take a look at:
    DB_ENV->set_errfile
    http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_set_errfile.html
    Please post any additional messaging from that.
    It that sheds no light on the problem, please post a
    small, stand-alone test case which reproduces the problem
    and I can take a further look.
    Thanks,
    Sandra

  • Lock on environment init / FreeBSD 4.x

    We experience problem with mutexes.
    We tried Berkeley DB 3.x and 4.5. We use FreeBSD 4.9-RELEASE.
    Initialization looks like that:
    my $global_env = new BerkeleyDB::Env
    -Home => $Path::Cache,
    -Flags => BerkeleyDB::DB_INIT_MPOOL() | BerkeleyDB::DB_INIT_CDB() | BerkeleyDB::DB_CREATE() | BerkeleyDB::DB_SYSTEM_MEM(),
    -LockDetect => BerkeleyDB::DB_LOCK_DEFAULT(),
    -SharedMemKey => $bdb_shmem_id;
    We have many concurrent processes, two of them write and others read.
    After some time all processes lock. If we run any new process then it locks on environment initialization. All db_* utilities get locked after start as well.
    After debugging we found that it seems like when any of processes die with signal (e.g. SIGSEGV or SIGBUS) then it leaves a mutex which others cannot overcome.
    We found that processes are stuck in LOCK_SYSTEM_LOCK
    Please, advise.

    Hi user629837,
    In a multiprocess environment, if you have process shared mutex and while holding a lock using LOCK_SYSTEM_LOCK macro a process exits (SIGSEGV or SIGBUS), the rest of the system will remain locked for ever. The application therefore should be designed carefully so that such situation doesn't arise.
    If using CDS, the subsystem flags like DB_INIT_LOCK, DB_INIT_TXN or DB_RECOVER should not be used. The DB_CREATE flag should be used if the database have to be created the first time or recreated after cleanup. Refer to the "Berkeley DB Concurrent Data Store Applications" section in Reference guide of BDB for more information.
    Regards,
    Debsubhra

  • ThinkVantage button startup behavior changes after Rescue and Recovery

    I recently bought a Thinkpad X301 (2777-CTO). When booting my computer, I see the following message: "To interrupt normal startup, press the blue ThinkVantage button". Initially, when I press this ThinkVantage button on startup, I get a "Startup Interrupt Menu", pictured at http://img90.imageshack.us/img90/4773/startupinterruptmenu.png
    This menu is useful since it allows me to either enter the BIOS, start Rescue and Recovery, select a device to boot from, or simply start normally. However, after choosing the Rescue and Recovery option once, this menu no longer appears. Instead, it goes straight to Rescue and Recovery from there on without giving me the choice to enter the BIOS configuration or select a boot device.
    I find this new behavior problematic for a few reasons:
    - The behavior of the ThinkVantage button at startup is inconsistent (a menu that should appear no longer does after running Rescue and Recovery once).
    - There appears to be no straight-forward way of reverting back to the desired (original) behavior.
    - The initial prompt on the power-on splash screen is now misleading. Although it still says "To interrupt normal startup, press the blue ThinkVantage button"; the way the button acts, it would probably be more accurate to say "To start Rescue and Recovery, press the blue ThinkVantage button" instead.
    - This behavior breaks the "Option Keys Display" option in the BIOS setup. Although I enabled this option, which should cause the system to display which key does what (e.g., F1 for BIOS), this is not displayed.
    - Running Rescue and Recovery results in a loss of functionality (instead of simply restoring the system to the initial state).
    - And anytime I press the blue ThinkVantage button (as instructed) instead of F1 or F12, I end up wasting several minutes, waiting for Rescue and Recovery to finish booting before I can properly shut it down and try again.
    This problem appears to have existed for a long time (since 2008; http://forum.notebookreview.com/lenovo-ibm/241845-thinkvantage-boot-menu-boots-straight-into-rescue-... ). However, the only "solution" that I have found is just a workaround: avoid pressing the ThinkVantage button (as instructed by the power-on splash screen).
    The ideal solution would be to have a BIOS (or Rescue and Recovery) update which will prevent the ThinkVantage button from losing its original function after running Rescue and Recovery. I know that this is a minor bug, but this bug and another BIOS bug (in the network boot order menu, which I'll post after this one), which arose in less than a week after I received the computer, makes me question the ThinkPad's reputation for high-quality engineering.

    ThinkPad
    Service and Troubleshooting Guide
    Finding information with the ThinkVantage button
    The blue ThinkVantage button can help you in many situations when your
    computer is working normally, and even when it is not. Press the
    ThinkVantage button to open the Productivity Center thinkvantage toolbox and get access to
    informative illustrations and easy-to-follow instructions for getting started and
    staying productive.
    You can also use the ThinkVantage button to interrupt the startup sequence of
    your computer and start the Rescue and Recovery

    in the windows environment it no longer opens productivity center it opens the toolbox if the toolbox is installed 
    Thinkpad R61 7733-1GU
    Thinkpad X61T 7762-54U
    Thinkpad X60T 6363-4GU
    Did a member help you today? Thank them with a Kudo!
    If a post answers your question, please mark it as an "Accepted Solution"!
    Regards,
    GMAC

  • How to migrate a suspended domain from one server to another?

    I am using oracle vm server 2.2.2 and i am trying to create the disaster recovery strategy for my environment
    Initially i have successfully paused the vm VM1 using the "xm save VM1 suspended_file " command and save the memory to a file named suspended_file
    then i backed up the directory under OVS/runnning_pool on the magnetic tape includind the suspended file
    when i tried to restore the vm1 to a new server i was not able to restore the vm using the xm restore command.I have import the virtual machine from vm manager and therefore the paths in configuration file contains the correct paths pointing to the images in the new server pool.
    however the following error appears when run the xm restore suspended_file
    Error :disk image does not exit /old_path_to_the_image
    For unknown reason the suspended file contains the old path to the disk image.Is there any way to alter the suspended file in order to point to the new directory
    If i start the vm ignoring the suspend file could cause any problems ?
    thanks in advance.
    i am waiting for your responses

    If all of the database files, including the binaries, are on a SAN you might be able to...
    1. Cold backup of everything - database files and binaries.
    2. Dismount the SAN volumes from the old server.
    3. Mount the SAN volumes to the new server - using the same mount points.
    4. Start up the database on the new server.
    If the OS version/release are the same between new and old, that should be about all you need to do.
    If the OS is same but upgraded to new version/release you will want to relink the Oracle executables before starting up.

  • Db file in Replica was created in wrong folder

    Hello!
    I created db file at \BDB_HOME\BDB_SUBx in Master, but in Replica site db file was created in wrong folder which is BDB_HOME.
    Do I miss something than setting path to DatabaseEnvironmentConfig.CreationDir ?
    \BDB_HOME
    |
    -BDB_SUB1
    -BDB_SUB2
    -BDB_SUB3
    FYI
    Ver.5.1.19 (HA)
    C#
    VisualStudio.Net 2010
    Thanks,
    Osamu

    Hi Osamu,
    This is a known limitation with BDB HA at the moment. This issue is tracked internally in SR #19041. We hope to fix it, but do not guarantee that it will make it, in the next BDB release, 5.2.
    Osamu, if you have access to MOS (MyOracle Support) please consult Note 1250654.1 (Doc ID 1250654.1) -- How to Correctly Replicate a Directory Structure Involving Subdirectories Between Master and Client. This article explains in detail this issue and how to work around it for now.
    For reference, to explain the issue in more detail, suppose on the master the environment directory structure looks something like this:
    \BDB_ENV_HOME
         \BDB_SUBDIR_1
         - DbFile_1_1.db
         - DbFile_1_2.db
         - DbFile_1_N.db
         \BDB_SUBDIR_2
         - DbFile_2_1.db
         - DbFile_2_2.db
         - DbFile_2_N.db
         \BDB_SUBDIR_M
         - DbFile_M_1.db
         - DbFile_M_2.db
         - DbFile_M_N.dbOn the client site, the environment directory structure will be incorrectly replicated and will look something similar to this (with all database files ending up under one of the subdirectories):
    \BDB_ENV_HOME
         \BDB_SUBDIR_1
         \BDB_SUBDIR_2
         \BDB_SUBDIR_M
         - DbFile_1_1.db
         - DbFile_1_2.db
         - DbFile_1_N.db
         - DbFile_2_1.db
         - DbFile_2_2.db
         - DbFile_2_N.db
         - DbFile_M_1.db
         - DbFile_M_2.db
         - DbFile_M_N.dbThe workaround to resolve this issue depends on a manual hot backup. AUTOINIT should be turned off via rep_set_config with DB_REP_CONF_AUTOINIT and 0. Than the client should be bootstrapped with the databases and logs from the master and recovery should be run as described in the Berkeley DB Programmer's Reference Guide, in the Hot failover section.
    Basically, copy all the databases, copy the logs, run catastrophic recovery on the new client environment directory, and start the application. By turning off AUTOINIT you might need to take care of handling the REP_JOIN_FAILURE event error.
    To summarize, the workaround implies the following actions:
    1. On the client environment call DbEnv::rep_set_config like this:
    DbEnv::rep_set_config(DB_REP_CONF_AUTOINIT, 0);With the C# API it's something like:
    DatabaseEnvironmentConfig envConfig = new DatabaseEnvironmentConfig();
    envConfig.RepSystemCfg = new ReplicationConfig();
    envConfig.RepSystemCfg.AutoInit = false;
    DatabaseEnvironment env = DatabaseEnvironment.Open(envHomeDir, envConfig);or you could use the DatabaseEnvironment's class RepAutoInit property.
    2. Handle DB_REP_JOIN_FAILURE on the client environment, which could be returned from DbEnv::rep_process_message. Handling implies setting an event callback function via set_event_notify for DB_EVENT_REP_JOIN_FAILURE like this:
    DbEnv::set_event_notify(eventsHandler);where eventsHandler is a callback function that respects this signature:
    void (*db_event_fcn)(DB_ENV *dbenv, u_int32_t event, void *event_info)and internally checks to see if event is DB_EVENT_REP_JOIN_FAILURE. If it is, it may trigger copying of the backup files from the master onto the client.
    With the C# API you will set an EventNotifyDelegate delegate using the EventNotify property and check the NotificationEvent.
    3. Start the client. Because AUTOINIT is turned off, internal init will not be performed, hence it will not remove the directory structure on the client environment.
    4. If the event callback function gets notified of the DB_EVENT_REP_JOIN_FAILURE it means that the backup of the master (databases and log files of the master) is required on the client. Take a manual hot backup as per the guidelines in the Hot failover section, and copy the database and log files onto the client; this is something that the event callback function can do, when it handles DB_EVENT_REP_JOIN_FAILURE by using something like rsync to copy the files between the machines.
    5. If a backup was copied onto the client, run a catastrophic recovery in the client environment either manually via db_recover -c, or programmatically by specifying the DB_RECOVER_FATAL flag to the client's DbEnv::open call (with the C# API you specify it via RunFatalRecovery)
    6. After the catastrophic recovery will have been performed and the client will have started, all the replication synchronization will work as expected, replication messages will be processed correctly, and the directory structure will be maintained.
    Regards,
    Andrei

  • Very subtle DB corruption ?

    Hello all,
        I'm experiencing what I call a very subtle bug. Subtle because there are no exceptions, no memory leak, not even an error message.
        My application uses BDB XML and it inserts, updates, removes and searches documents - pretty basic functionality. But after some time of use, my users are calling me saying the searches never return any results. I mean, they send a request, then it's sent to BDB, but it doesnt return.
        First I thought it was another memory leak, but memory cosumption is high as always, but it is stable at some point. Just for checking, I restarted the server and tried searching again - dog slow, no return, even with 600MB free RAM.
        The only solution was to run recovery, which I chose to do manually at this time (and I dont do it automatically yet). Started the server, and then it returns to its normal state.
         So, I can just wonder what can possibility cause this? The containers are getting corrupted (although no corruption messages appear)? My Environment is managed by this class:
    package br.gov.al.delegaciainterativa.controles;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import javax.naming.LimitExceededException;
    import br.gov.al.delegaciainterativa.utils.Dir;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlContainerConfig;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlManagerConfig;
    public class EnvironmentInit {
        private Environment myEnv; // objeto ambiente
        private XmlManager myManager;
        private XmlManagerConfig managerConfig;
        private File envPath;
        private boolean ismyEnvOpen = false;
        private String nomeAmbiente;
        private String separador;
        private String envHome;
        private ArrayList containersAbertos;
        public EnvironmentInit(String envHome, String nomeAmbiente)
                throws Throwable {
            this.nomeAmbiente = nomeAmbiente;
            containersAbertos = new ArrayList();
            separador = System.getProperty("file.separator"); // pega o separador
            this.envHome = envHome + separador + nomeAmbiente;
             System.out.println(".EnvironmentInit:iniciar");       
            iniciar();
        public EnvironmentInit(String envHome, String nomeAmbiente, XmlManager mgr)
        throws Throwable {
            this.nomeAmbiente = nomeAmbiente;
            this.myManager = mgr;
            containersAbertos = new ArrayList();
            separador = System.getProperty("file.separator"); // pega o separador
            this.envHome = envHome + separador + nomeAmbiente;
            iniciar();
        private void iniciar() throws Exception {
            Dir.criarDiretorio(this.envHome); // cria o diretorio
            envPath = new File(this.envHome); // converte o caminho de String p/ File, requerido pelo construtor do Environment
            //System.out.println(envPath);
            if (!envPath.isDirectory()) {
    //            System.out.println("Criando dir.. " + envHome);
    //            Dir.criarDiretorio(this.envHome);
                throw new Exception(envPath.getPath()
                        + " does not exist or is not a directory.");
            try {
                EnvironmentConfig envConf = new EnvironmentConfig();
                //envConf.setCacheSize(50 * 1024 * 1024); //let default cache size.
                envConf.setAllowCreate(true); // If the environment does not
                                              // exits,create it.
                envConf.setInitializeCache(true); // Turn on the shared memory
                                                  // region.
                envConf.setInitializeLocking(true); // Turn on the locking
                                                     // subsystem
                envConf.setInitializeLogging(true); // Turn on the logging subsystem
                envConf.setTransactional(true); // Turn on the transactional
                                                // subsystem - Passo 1 para setar transa??????es.
                //envConf.setLogInMemory(true);
                //envConf.setLogBufferSize(10 * 1024 * 1024); //100 Mbs de log. Logs são usados para recuperação do banco em caso de corrupção.
                envConf.setErrorStream(System.err);
                //envConf.setRunRecovery(true); // Roda o recovery automaticamente
                myEnv = new Environment(envPath, envConf);
                managerConfig = new XmlManagerConfig();
                managerConfig.setAdoptEnvironment(true); // autoriza ao XmlManager, quando for fechado, fechar tamb???m o ambiente
                //  managerConfig.setAllowAutoOpen(true); // autoriza a abrir um
                                                      // container automaticamente
                //managerConfig.setAllowExternalAccess(true); // acesso externo
                myManager = new XmlManager(myEnv, managerConfig);
                myManager.setDefaultContainerType(XmlContainer.WholedocContainer);
                ismyEnvOpen = true;
            } catch (DatabaseException de) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar - erro no banco");
            } catch (FileNotFoundException fnfe) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar - Config faltando");
            } catch (Exception e) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar  \n" + e.toString());
        //Returns the path to the database environment
        public File getDbEnvPath() {
            return envPath;
        //Returns the database environment encapsulated by this class.
        public Environment getEnvironment() {
            return myEnv;
        //Returns the XmlManager encapsulated by this class.
        public XmlManager getManager() {
            return myManager;
         * Reabre o container com as configura??????es j??? preparadas. ??? necess???rio
         * re-abrir posteriormente os containers
        public void reabrir() {
            if (ismyEnvOpen == false) {
                try {
                    iniciar();
                    //System.out.println(".EnvironmentInit: reabrir()");
                } catch (Exception e) {
                    System.err.println("[erro] EnvironmentInit:iniciar - Erro ao tentar reabrir ambiente!");
                    //e.printStackTrace();
        public String getName() {
            return nomeAmbiente;
        public void cleanup() throws DatabaseException {
            ismyEnvOpen = false;
            fechaContainersAbertos();
            try {
                if (myManager != null) {
                    // myEnv.close(); // fechado automaticamente pelo myManager
                    //myManager.close();
                    myManager.delete(); //trocado pelo close() pois é mais seguro.
                    ismyEnvOpen = false;
            } catch (Exception de) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar - N�o conseguiu fechar o banco");
            System.out.println(".EnvironmentInit:cleanup");
        private void registraContainerAberto(XmlContainer container) {
            containersAbertos.add(container);
        private void fechaContainersAbertos() {
            for (int i = 0; i < containersAbertos.size(); i++) {
                try {
                    System.out.println(".EnvironmentInit:fechaContainer:" + ((XmlContainer) containersAbertos.get(i)).getName());
                    ((XmlContainer) containersAbertos.get(i)).closeContainer();
                    ((XmlContainer) containersAbertos.get(i)).delete(); //realmente garante o fechamento, destruindo o objeto associado.
                } catch (XmlException e) {
                    System.err
                            .println("[erro] EnvironmentInit:iniciar - Erro ao tentar fechar container");
                    e.printStackTrace();
            containersAbertos.clear();
        public XmlManagerConfig getXmlManagerConfig() {
            return managerConfig;
        public XmlContainer abrirContainer(String nome) {
            int ind = indiceContainerRegistrado(nome);
            XmlContainer container = null;
            if (ind >= 0) {
                //System.out.println(".EnvironmentInit:abrirContainer (j??? aberto) : " + nome + " - ambiente aberto!");
                return (XmlContainer) containersAbertos.get(ind);
            boolean existe = Dir
                    .existeArquivo(envPath.toString() + separador, nome);
            try {
                if (!existe) {
                    container = myManager.createContainer(nome);               
                    System.out.println(".EnvironmentInit:abrirContainer (create) : " + nome + " - criando container");
                    return null;
                } else {
                     System.out.println(".EnvironmentInit:abrirContainer - nome = '" nome "'");
                    XmlContainerConfig conf = new XmlContainerConfig();
                    conf.setAllowCreate(true);
                    conf.setTransactional(true);
                     container = myManager.openContainer(nome, conf);
                    //System.out.println(".EnvironmentInit:abrirContainer (open) : " + nome + " - ambiente aberto!");
                registraContainerAberto(container); // registra que o container foi
                // aberto
                return container;
            } catch (XmlException e) {
                e.printStackTrace();
            return null;
        public boolean removeContainer(XmlContainer c) {
            String path = null;
            try {
                path = envPath.toString() + separador + c.getName();
                //.closeContainer();
                c.delete(); //trocado pelo close acima por ser mais seguro.
                myManager.removeContainer(path);
                System.out.println(".EnvironmentInit:removeContainer : " + path);
                return true;
            } catch (XmlException e) {
                System.err.println("[erro] EnvironmentInit:iniciar - Erro ao tentar remover container ");
                //e.printStackTrace();
            return false;
        public int indiceContainerRegistrado(String nome) {
            try {
                for (int i = 0; i < containersAbertos.size(); i++) {
                    XmlContainer cont = (XmlContainer)containersAbertos.get(i);
                    if (cont.getName().compareTo(nome) == 0)
                        return i;
            } catch (Exception e) {
            return -1;
        Is there anything wrong with it, that could be causing this? Any help would be much appreciated.
    thanks,
    -- Breno Costa

    Hello all,
        I'm experiencing what I call a very subtle bug. Subtle because there are no exceptions, no memory leak, not even an error message.
        My application uses BDB XML and it inserts, updates, removes and searches documents - pretty basic functionality. But after some time of use, my users are calling me saying the searches never return any results. I mean, they send a request, then it's sent to BDB, but it doesnt return.
        First I thought it was another memory leak, but memory cosumption is high as always, but it is stable at some point. Just for checking, I restarted the server and tried searching again - dog slow, no return, even with 600MB free RAM.
        The only solution was to run recovery, which I chose to do manually at this time (and I dont do it automatically yet). Started the server, and then it returns to its normal state.
         So, I can just wonder what can possibility cause this? The containers are getting corrupted (although no corruption messages appear)? My Environment is managed by this class:
    package br.gov.al.delegaciainterativa.controles;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import javax.naming.LimitExceededException;
    import br.gov.al.delegaciainterativa.utils.Dir;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlContainerConfig;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlManagerConfig;
    public class EnvironmentInit {
        private Environment myEnv; // objeto ambiente
        private XmlManager myManager;
        private XmlManagerConfig managerConfig;
        private File envPath;
        private boolean ismyEnvOpen = false;
        private String nomeAmbiente;
        private String separador;
        private String envHome;
        private ArrayList containersAbertos;
        public EnvironmentInit(String envHome, String nomeAmbiente)
                throws Throwable {
            this.nomeAmbiente = nomeAmbiente;
            containersAbertos = new ArrayList();
            separador = System.getProperty("file.separator"); // pega o separador
            this.envHome = envHome + separador + nomeAmbiente;
             System.out.println(".EnvironmentInit:iniciar");       
            iniciar();
        public EnvironmentInit(String envHome, String nomeAmbiente, XmlManager mgr)
        throws Throwable {
            this.nomeAmbiente = nomeAmbiente;
            this.myManager = mgr;
            containersAbertos = new ArrayList();
            separador = System.getProperty("file.separator"); // pega o separador
            this.envHome = envHome + separador + nomeAmbiente;
            iniciar();
        private void iniciar() throws Exception {
            Dir.criarDiretorio(this.envHome); // cria o diretorio
            envPath = new File(this.envHome); // converte o caminho de String p/ File, requerido pelo construtor do Environment
            //System.out.println(envPath);
            if (!envPath.isDirectory()) {
    //            System.out.println("Criando dir.. " + envHome);
    //            Dir.criarDiretorio(this.envHome);
                throw new Exception(envPath.getPath()
                        + " does not exist or is not a directory.");
            try {
                EnvironmentConfig envConf = new EnvironmentConfig();
                //envConf.setCacheSize(50 * 1024 * 1024); //let default cache size.
                envConf.setAllowCreate(true); // If the environment does not
                                              // exits,create it.
                envConf.setInitializeCache(true); // Turn on the shared memory
                                                  // region.
                envConf.setInitializeLocking(true); // Turn on the locking
                                                     // subsystem
                envConf.setInitializeLogging(true); // Turn on the logging subsystem
                envConf.setTransactional(true); // Turn on the transactional
                                                // subsystem - Passo 1 para setar transa??????es.
                //envConf.setLogInMemory(true);
                //envConf.setLogBufferSize(10 * 1024 * 1024); //100 Mbs de log. Logs são usados para recuperação do banco em caso de corrupção.
                envConf.setErrorStream(System.err);
                //envConf.setRunRecovery(true); // Roda o recovery automaticamente
                myEnv = new Environment(envPath, envConf);
                managerConfig = new XmlManagerConfig();
                managerConfig.setAdoptEnvironment(true); // autoriza ao XmlManager, quando for fechado, fechar tamb???m o ambiente
                //  managerConfig.setAllowAutoOpen(true); // autoriza a abrir um
                                                      // container automaticamente
                //managerConfig.setAllowExternalAccess(true); // acesso externo
                myManager = new XmlManager(myEnv, managerConfig);
                myManager.setDefaultContainerType(XmlContainer.WholedocContainer);
                ismyEnvOpen = true;
            } catch (DatabaseException de) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar - erro no banco");
            } catch (FileNotFoundException fnfe) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar - Config faltando");
            } catch (Exception e) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar  \n" + e.toString());
        //Returns the path to the database environment
        public File getDbEnvPath() {
            return envPath;
        //Returns the database environment encapsulated by this class.
        public Environment getEnvironment() {
            return myEnv;
        //Returns the XmlManager encapsulated by this class.
        public XmlManager getManager() {
            return myManager;
         * Reabre o container com as configura??????es j??? preparadas. ??? necess???rio
         * re-abrir posteriormente os containers
        public void reabrir() {
            if (ismyEnvOpen == false) {
                try {
                    iniciar();
                    //System.out.println(".EnvironmentInit: reabrir()");
                } catch (Exception e) {
                    System.err.println("[erro] EnvironmentInit:iniciar - Erro ao tentar reabrir ambiente!");
                    //e.printStackTrace();
        public String getName() {
            return nomeAmbiente;
        public void cleanup() throws DatabaseException {
            ismyEnvOpen = false;
            fechaContainersAbertos();
            try {
                if (myManager != null) {
                    // myEnv.close(); // fechado automaticamente pelo myManager
                    //myManager.close();
                    myManager.delete(); //trocado pelo close() pois é mais seguro.
                    ismyEnvOpen = false;
            } catch (Exception de) {
                // Exception handling goes here
                System.err.println("[erro] EnvironmentInit:iniciar - N�o conseguiu fechar o banco");
            System.out.println(".EnvironmentInit:cleanup");
        private void registraContainerAberto(XmlContainer container) {
            containersAbertos.add(container);
        private void fechaContainersAbertos() {
            for (int i = 0; i < containersAbertos.size(); i++) {
                try {
                    System.out.println(".EnvironmentInit:fechaContainer:" + ((XmlContainer) containersAbertos.get(i)).getName());
                    ((XmlContainer) containersAbertos.get(i)).closeContainer();
                    ((XmlContainer) containersAbertos.get(i)).delete(); //realmente garante o fechamento, destruindo o objeto associado.
                } catch (XmlException e) {
                    System.err
                            .println("[erro] EnvironmentInit:iniciar - Erro ao tentar fechar container");
                    e.printStackTrace();
            containersAbertos.clear();
        public XmlManagerConfig getXmlManagerConfig() {
            return managerConfig;
        public XmlContainer abrirContainer(String nome) {
            int ind = indiceContainerRegistrado(nome);
            XmlContainer container = null;
            if (ind >= 0) {
                //System.out.println(".EnvironmentInit:abrirContainer (j??? aberto) : " + nome + " - ambiente aberto!");
                return (XmlContainer) containersAbertos.get(ind);
            boolean existe = Dir
                    .existeArquivo(envPath.toString() + separador, nome);
            try {
                if (!existe) {
                    container = myManager.createContainer(nome);               
                    System.out.println(".EnvironmentInit:abrirContainer (create) : " + nome + " - criando container");
                    return null;
                } else {
                     System.out.println(".EnvironmentInit:abrirContainer - nome = '" nome "'");
                    XmlContainerConfig conf = new XmlContainerConfig();
                    conf.setAllowCreate(true);
                    conf.setTransactional(true);
                     container = myManager.openContainer(nome, conf);
                    //System.out.println(".EnvironmentInit:abrirContainer (open) : " + nome + " - ambiente aberto!");
                registraContainerAberto(container); // registra que o container foi
                // aberto
                return container;
            } catch (XmlException e) {
                e.printStackTrace();
            return null;
        public boolean removeContainer(XmlContainer c) {
            String path = null;
            try {
                path = envPath.toString() + separador + c.getName();
                //.closeContainer();
                c.delete(); //trocado pelo close acima por ser mais seguro.
                myManager.removeContainer(path);
                System.out.println(".EnvironmentInit:removeContainer : " + path);
                return true;
            } catch (XmlException e) {
                System.err.println("[erro] EnvironmentInit:iniciar - Erro ao tentar remover container ");
                //e.printStackTrace();
            return false;
        public int indiceContainerRegistrado(String nome) {
            try {
                for (int i = 0; i < containersAbertos.size(); i++) {
                    XmlContainer cont = (XmlContainer)containersAbertos.get(i);
                    if (cont.getName().compareTo(nome) == 0)
                        return i;
            } catch (Exception e) {
            return -1;
        Is there anything wrong with it, that could be causing this? Any help would be much appreciated.
    thanks,
    -- Breno Costa

Maybe you are looking for

  • Adding new map in apex 4.0

    Hello I've just installed new apex and it looks nice But as I've found the map of Poland is way out of date (administration plan has changed in 1999 but guys from AnyMap just missed that ;D ) I've downloaded new map in .shp format and converted it to

  • Inserting record in table on selection of another table

    Hi All, I have a table with multiple line items, and i have one insert button. If i select line items in first table i want to create new records in 2nd table that is new structure( some values are same ). Here problem is i am getting all records in

  • Word Documents from Outlook 2003

    Most of the users in my company are on Windows, using Outlook to send email. My art department, who are G5s, use Mail. Both receive mail from external POP3 accounts. When the office manager sends memos in Word document format to the art department, t

  • Why my exit menu did work???

    this is my codes.no syntax errors.ubt the exit menu does not work.can someone correct it???please... import java.awt.*; import java.applet.*; import java.awt.event.*; public class GUI extends Applet Frame window; public void init() Object f =getParen

  • Any KM which can insert , update and delete

    hi everyone , i have a oracle target which i want to keep synchronize daily with sql server source which means if there is any deletion in source ,i want a deletion in target too . Hope iam clear . Is there is any KM that can do insert ,update and de