| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
object TransactionContext
extends
TransactionProtocol with Loggable
implicit val txService = TransactionServices.AtomikosTransactionService.
Example usage 1:
for {
ctx <- TransactionContext.Required
entity <- updatedEntities
if !ctx.isRollbackOnly
} {
// transactional stuff
ctx.getEntityManager.merge(entity)
}
Example usage 2:
val users = for {
ctx <- TransactionContext.Required
name <- userNames
} yield {
// transactional stuff
val query = ctx.getEntityManager.createNamedQuery("findUserByName")
query.setParameter("userName", name)
query.getSingleResult
}
- Jonas Bonér
def this
|
| Mandatory.. |
object Mandatory
|
|
|
| Never.. |
object Never
|
|
|
| NoOpTransactionMonad.. |
object NoOpTransactionMonad
|
|
|
| Required.. |
object Required
|
|
|
| RequiresNew.. |
object RequiresNew
|
|
|
| Supports.. |
object Supports
|
|
|
| logger.. |
protected val logger
|
Logger | Loggable |
| !=.. |
final def !=(arg0 : Any)
|
Boolean | Any |
| !=.. |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| ==.. |
final def ==(arg0 : Object)
|
Boolean | AnyRef |
| ==.. |
final def ==(arg0 : Any)
|
Boolean | Any |
| asInstanceOf.. |
final def asInstanceOf[T0]
|
T0 | Any |
| clone.. |
protected def clone
|
Object | AnyRef |
| commitOrRollBack.. |
protected def commitOrRollBack(tm : TransactionManager)
|
Unit | TransactionProtocol |
| eq.. |
final def eq(arg0 : Object)
|
Boolean | AnyRef |
| equals.. |
def equals(arg0 : Any)
|
Boolean | AnyRef |
| finalize.. |
protected def finalize
|
Unit | AnyRef |
| getClass.. |
final def getClass
|
Class[Any] | AnyRef |
| handleException.. |
protected def handleException(tm : TransactionManager, e : Exception)
|
Nothing | TransactionProtocol |
| hashCode.. |
def hashCode
|
Int | AnyRef |
| isInExistingTransaction.. |
protected def isInExistingTransaction(tm : TransactionManager)
Checks if a transaction is an existing transaction
[details]
|
Boolean | TransactionProtocol |
| isInstanceOf.. |
final def isInstanceOf[T0]
|
Boolean | Any |
| isRollbackOnly.. |
protected def isRollbackOnly(tm : TransactionManager)
Checks if current transaction is set to rollback only
[details]
|
Boolean | TransactionProtocol |
| ne.. |
final def ne(arg0 : Object)
|
Boolean | AnyRef |
| notify.. |
final def notify
|
Unit | AnyRef |
| notifyAll.. |
final def notifyAll
|
Unit | AnyRef |
| synchronized.. |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| toString.. |
def toString
|
String | AnyRef |
| wait.. |
final def wait
|
Unit | AnyRef |
| wait.. |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| wait.. |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| withTxMandatory.. |
def withTxMandatory[T](body : => T)
Wraps body in a transaction with MANDATORY semantics
[details]
Throws a TransactionRequiredException if there is no transaction active in scope.
|
T | TransactionProtocol |
| withTxNever.. |
def withTxNever[T](body : => T)
Wraps body in a transaction with NEVER semantics
[details]
Throws a SystemException in case of an existing transaction in scope.
|
T | TransactionProtocol |
| withTxNotSupported.. |
def withTxNotSupported[T](body : => T)
Wraps body in a transaction with NOT_SUPPORTED semantics
[details]
Suspends existing transaction, invokes body, resumes transaction.
|
T | TransactionProtocol |
| withTxRequired.. |
def withTxRequired[T](body : => T)
Wraps body in a transaction with REQUIRED semantics
[details]
Creates a new transaction if no transaction is active in scope, else joins the outer transaction.
|
T | TransactionProtocol |
| withTxRequiresNew.. |
def withTxRequiresNew[T](body : => T)
Wraps body in a transaction with REQUIRES_NEW semantics
[details]
Suspends existing transaction, starts a new transaction, invokes body,
commits or rollbacks new transaction, finally resumes previous transaction.
|
T | TransactionProtocol |
| withTxSupports.. |
def withTxSupports[T](body : => T)
Wraps body in a transaction with SUPPORTS semantics
[details]
Basicalla a No-op.
|
T | TransactionProtocol |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |