Re: [ojb-users] Multi-database questions?
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-05-17 13:48:16
|
Hi Scott, Weaver, Scott wrote: > A couple of quick multi-db questions. > > I have 2 class descriptors (A and B), each using a different jdbc > connection (different RDBMSes)... > > 1. Can I use a foreign-key relation from to A to B (or vice versa)? Yes, that's possible > From what I have read this appears to be possible since (I think) ojb > will use 2 independent JDBC calls, one to materialize A initially then > another to materialize B within A. exactly! > > 2. Can A and B, being in different RDBMSes, participate in the same > transaction? > Depends on the API you use: If you are using the ODMG API you can work against multiple databases, as the tx management is done on the ODMG level without any JDBC interference. If you are using the PersistenceBroker API you can use the PB methods beginTransaction() and commitTransaction(). They will properly handle the JDBC transactions against multiple databases. BUT: Both ways are currently not two phase commit safe. That is if one of the underlying JDBC transaction fails previously commited JDBC transactions are not rolled back! HTH, Thomas > > Thanks, > Scott > > |