|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.jtx.worker.LeanTransactionWorker
public class LeanTransactionWorker
Lean transaction worker helps dealing transactions when they were requested in several places, usually in separated methods. This worker knows when requested transaction is the same as current one, or completely new. It might be useful for aspects.
Field Summary | |
---|---|
protected JtxTransactionManager |
txManager
|
Constructor Summary | |
---|---|
LeanTransactionWorker(JtxTransactionManager txManager)
|
Method Summary | |
---|---|
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)
Requests for transaction and returns non-null value only when new transaction is created! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final JtxTransactionManager txManager
Constructor Detail |
---|
public LeanTransactionWorker(JtxTransactionManager txManager)
Method Detail |
---|
public JtxTransactionManager getTransactionManager()
public JtxTransaction getCurrentTransaction()
null
if there is no transaction at the moment.
public JtxTransaction maybeRequestTransaction(JtxTransactionMode txMode)
null
is returned, transaction may be get by
getCurrentTransaction()
.
JtxTransactionManager.requestTransaction(jodd.jtx.JtxTransactionMode)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |