Wednesday, January 8, 2014

What is local and global transactions?

Q) What is local and global transactions?

A)
LOCAL_TXN




GLOBAL_TXN

Any of the following happens:
An Oracle DDL statement (CREATEDROPRENAMEALTER) is executed.
commit() is invoked.
rollback() is invoked (parameterless version only).

Within a global transaction open on this connection, end() is invoked on an XAResourceobtained from the XAconnection that provided this connection.


  • In LOCAL_TXN mode, applications must not invoke prepare()commit()rollback()forget(), or end() on an XAResource. Doing so causes an XAException to be thrown.
  • In GLOBAL_TXN mode, applications must not invoke commit()rollback() (both versions), setAutoCommit(), or setSavepoint() on a java.sql.Connection, and must not invoke OracleSetSavepoint() ororacleRollback() on an oracle.jdbc.OracleConnection. Doing so causes an SQLException to be thrown.

No comments:

Post a Comment