Hi If I get a connection from a datasource (conn pool) then what is the difference between (1)commit()/rollback() on the connection direction Versus (2) commit() /rollback() on the user transaction Thanks
connect.commit() is database process and usertxn.commit() is user process right? But what does this mean to the developer or to the runtime? Given that there are two choices of doing things, which one should I pick and why?
Babji, They mean different things. Suppose a transaction contains multiple database connections. Committing the user transaction would commit all of them. Whereas committing the connection would only commit one.
Thanks Jeanne, If a transaction contains multiple database connections, then its a distributed /XA transaction right? Lets keep it as multiple i/o operations with the same database. which can be commit/rollback either using a single usertransaction or connection.
When we use UserTransaction the transaction manager/service uses a default timeout (which if we want, we can overwrite using setTransactionTimeout method) But if I use a connection directly (for a set of lengthy database processes) then I donot need to worry about the timeout. is this right? If so is this the only difference?