Bruce,
I was first thinking doing it this way.
But, after this insertion is successfull I need to remove the object from
the first database.
Besides this, there are also some other places where I need to work with two
databases.
For example, I need to insert data into two databases after a user fills a
form on the web interface.
This also will have to be done in a transactional manner. It seems that I
have to use a transaction manager after all...
Maybe I could try to do something like this with this archiving part:
db1.begin()
// load object from the db1
db2.begin()
// insert it into db2
db2.commit()
// remove it from the db1
db1.commit()
If the first commit() fails, I'll rollback() the db1 transaction (or just
commit without remove... :)).
If the second commit() fails, I'll db2.remove() the inserted object from
db2.
I'm not sure if this is a good solution, but maybe it'll suffice.
For the (most probable) bad performance impact of this approach,
I could try first to load all needed objects from the database in one OQL
query (hoping that castor will cache them),
and then load one by one... :)
Never mind, thank you for your help. :)
Best regards,
Emir
BS> Or he could just set up multiple <database> elements in the jdo-conf and
use each one in separate transactions to pull data from one data source and
commit it to the other.
BS>
BS> Bruce
BS> --
BS> perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
BS>
BS> The Castor Project
BS> http://www.castor.org/
BS>
BS> Apache Geronimo
BS> http://geronimo.apache.org/
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user