this is possible. The ...odmg.Implementation implementation class odmg.OJB is not a singleton, thus you can obtain two instances of this class and open two different databases (e.g. in a startup class).
Implementation ojb_1 = OJB.getInstance(); Database db1 = ojb_1.newDatabase(); ... Implementation ojb_1 = OJB.getInstance(); Database db1 = ojb_1.newDatabase(); ...
Now you can use both databases parallel, but keep in mind that OJB does not support distributed transactions (span one tx over both DB). To use this you have run OJB in a managed enviroment.
A test case using this approach in test suite is called ...odmg.MultiDBUsageTest.
regards, Armin
Coup, Robert Muir wrote:
Hi all,
Situation: We use a single data/db model which can either be an online network
database (PGSql) or an offline local one (HSQLDB). At startup time, the
user chooses which to use, and we just apply a different
connection-descriptor. That all works great.
Now one feature requires a connection to the online db and we wanted this to be made accessible for the offline users if they happen to be connected. I need to have 2 odmg connections open at the same time for a short period - is this possible? From a quick look through the OJB & DatabaseImpl docs it seems that OJB only supports a single open db...
Are there workarounds other than closing and opening each in turn?
Thanks for your help,
Rob :)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
