Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RunRecoveryException with multiple processes (environments)

694549May 2 2009 — edited May 4 2009
HI,

i have an application wherein same berkleye DB database(primary and a secondary index database) is being opened from two application running on two instances of tomcat servers, in effect opening two environments. When I use the database from one of these it works fine. As soon as I start the second application (hence opening a second environment handle), first application starts experiencing dbrecovery exceptions. The exact stack trace is below:

============
Caused by: com.sleepycat.db.RunRecoveryException: DB_RUNRECOVERY: Fatal error, run database recovery: PANIC: fatal region error detected; run recovery: DB_RUNRECOVERY: Fatal error, run database recovery
at com.sleepycat.db.internal.db_javaJNI.DbEnv_txn_begin(Native Method)
at com.sleepycat.db.internal.DbEnv.txn_begin(DbEnv.java:514)
at com.sleepycat.db.TransactionConfig.beginTransaction(TransactionConfig.java:355)
at com.sleepycat.db.Environment.beginTransaction(Environment.java:1153)
============

I am opening environments with joinEnvironment = true flag and I though that that should take care of this scenario. Please notice that error doesn't occur while the second environment is openend, it rather happens when the first process tries to open a new transaction. I have tried opening these with and without envConfig.setRunRecovery(true) both leading to same result

1) is there a limitation on number of environments that can be handled.
2) setting joinenvironment flag to true; does it allow one to join a 'live' environment (handle) or it allows you to rather open the existing environment with the existing environment settings specified _db00*.* file?
3) I am using environment and database settings given below. Can I open both the environments with exactly same settings or is there any limitation with respect to that?

i have tried searching for a similar thread on multi process app but unfortunately couldn't find one. It will be great if someone can help with some of these questions.

Thanks,
shishir


==================== Env Config ==========================


envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
envConfig.setInitializeCache(true);
envConfig.setInitializeLocking(true);
envConfig.setInitializeLogging(true);
envConfig.setCDBLockAllDatabases(true);
envConfig.setCacheSize(8*1024*1024);
envConfig.setMultiversion(true);
envConfig.setLockDetectMode(LockDetectMode.RANDOM);
envConfig.setLockDetectMode(LockDetectMode.DEFAULT);
envConfig.setJoinEnvironment(true);
envConfig.setTxnMaxActive(300);
envConfig.setRunRecovery(true);


====================== DB Config ==========================



dbConfig.setType(DatabaseType.BTREE);
dbConfig.setAllowCreate(true);
dbConfig.setTransactional(true);
dbConfig.setMultiversion(true);

====================== Index(secondary db config ) ========

eidIndexConfig.setAllowCreate(true);
eidIndexConfig.setType(DatabaseType.BTREE);
eidIndexConfig.setTransactional(true);
eidIndexConfig.setMultiKeyCreator(eidIndexCreator);
eidIndexConfig.setAllowPopulate(true);

===========================================================

Edited by: newbdb on May 2, 2009 4:48 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2009
Added on May 2 2009
2 comments
1,672 views