First page Back Continue Last page Graphics

Accessing a Transaction


Accessing a Transaction

You access an application module’s transaction context through the Transaction and DBTransaction interfaces. You can access the methods in these interfaces through the getTransaction() and getDBTransaction() methods in the ApplicationModuleImpl class.

Some useful methods of the Transaction interface with regard to application modules are:

commit: Commits the transaction; saves all changes to the database. If the database connection is established, the transaction is implicitly started.

connect: Attempts to establish a connection to the given database URL

disconnect: Disconnects the server from the database

getLockingMode: Gets the preferred locking mode for this transaction. In ADF BC, the locking mode defaults to LOCK_PESSIMISTIC; however, Oracle Fusion applications use optimistic locking by default.

rollback: Rolls back the transaction; discards all changes

setLockingMode: Sets the preferred locking mode for this transaction. Changing the locking mode affects only subsequent locks that are placed.