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()
Inherited Attributes
Attributes inherited from: Object
Methods
destroySource Codeshared actual void destroy(Throwable? exception)

Destroy this resource. Called when execution of the body of the try statement ends, even if an exception propagates out of the body of the try.

rollbackOnlySource Codeshared void rollbackOnly()

Set the transaction to roll back.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Destroyable