public interface Transaction
Transaction t = conn.transaction();
conn.countOperation(updateSql)
.resultProcessor( count -> { if (count > 1) t.setRollbackOnly(); } )
.submit();
conn.commit(t);
A Transaction can not be used to create more than one endTransaction
Operation.
A Transaction is thread safe.Modifier and Type | Method | Description |
---|---|---|
boolean |
isRollbackOnly() |
Returns
true iff the setRollbackOnly() method has been called
on this Transaction |
boolean |
setRollbackOnly() |
Causes an endTransactionOperation created with this Transaction that is executed
subsequent to this call to perform a rollback.
|
boolean setRollbackOnly()
boolean isRollbackOnly()
true
iff the setRollbackOnly()
method has been called
on this Transactiontrue
if setRollbackOnly()
has been called.Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
DRAFT JDBC 4.4 EA