public class LeanJtxWorker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected JtxTransactionManager |
txManager |
Constructor and Description |
---|
LeanJtxWorker(JtxTransactionManager txManager) |
Modifier and Type | Method and Description |
---|---|
JtxTransaction |
getCurrentTransaction()
Returns current transaction or
null if there is no transaction at the moment. |
JtxTransactionManager |
getTransactionManager()
Returns transaction manager.
|
boolean |
markOrRollbackTransaction(JtxTransaction tx,
java.lang.Throwable cause)
Rollbacks transaction if created in the same scope where this method is invoked.
|
boolean |
maybeCommitTransaction(JtxTransaction tx)
Commits transaction if created in the same level where this method is invoked.
|
JtxTransaction |
maybeRequestTransaction(JtxTransactionMode txMode,
java.lang.Object scope)
Requests for transaction and returns non-null value only when new transaction
is created!
|
protected final JtxTransactionManager txManager
public LeanJtxWorker(JtxTransactionManager txManager)
public JtxTransactionManager getTransactionManager()
public JtxTransaction getCurrentTransaction()
null
if there is no transaction at the moment.public JtxTransaction maybeRequestTransaction(JtxTransactionMode txMode, java.lang.Object scope)
null
is returned, transaction may be get by
getCurrentTransaction()
.public boolean maybeCommitTransaction(JtxTransaction tx)
true
if transaction was actually committed or false
if transaction was not created on this level.public boolean markOrRollbackTransaction(JtxTransaction tx, java.lang.Throwable cause)
true
if transaction was actually roll backed.Copyright © 2003-present Jodd Team