Begin a new database transaction. If rollbackOnly()
is called, or if an exception propagates out of try
,
the transaction will be rolled back. Otherwise, the
transaction will be committed.
Should be instantiated using try
:
try (tx = sql.Transaction()) { //do work here if (something) { tx.rollbackOnly(); } }
no subtypes hierarchy
Initializer |
Transaction() |
Methods | |
destroy | Source Codeshared actual void destroy(Throwable? exception) Destroy this resource. Called when execution of the
body of the Refines Destroyable.destroy |
rollbackOnly | Source Codeshared void rollbackOnly() Set the transaction to roll back. |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Destroyable |