How to use transactions to execute code currently?
Hi All,
i am attempting to perform a JDBC commit and an update to a log file, ie. i am recording the updates in a log file so i can use for recovery, however from the point of the transaction is commited to the point at which it is updated into the file the system can be exited thus the database and log file are out of sync. I was wondering if there are any transaction mechanisms that i can use to perform these at the same time so if the records get commited then the log is also updated however if either are missed then both are rolledback eg.
try{
myTransaction.begin();
connection.comitt();
updateLog();
myTransaction.comitt();
}catch(Exception ex){
myTransaction.rollback();
}
any help or advice will be greatly appreciated
Message was edited by:
uddinr0121
Message was edited by:
uddinr0121

