Hello.
I'm doing very small command line application that imports some data from a database to another database using the JDBC helper classes.
I have to write to the two databases:
-In the destination database i write the imported data
-In the source the database i write in a temporary table the data that was imported.
Because It's a very small and simple application it doesn't use JTA but I would like to configure the transaction Manager to rollback if i enconter a problem in anyone of the databases.
Can we do something like this?
I don't think that this rollback the two databases in case of an error.Code:transactionDest.execute(new TransactionCallback() { public Object doInTransaction(TransactionStatus arg0) { transactionSource.execute(new TransactionCallback() { public Object doInTransaction(TransactionStatus arg0) { migrateCompany(contractId); return null; } }); return null; } });
What do you sugest?


Reply With Quote