Class DefaultTransactionScopeManager
- java.lang.Object
-
- io.ebeaninternal.server.transaction.TransactionScopeManager
-
- io.ebeaninternal.server.transaction.DefaultTransactionScopeManager
-
- All Implemented Interfaces:
SpiTransactionScopeManager
- Direct Known Subclasses:
ExternalTransactionScopeManager
public class DefaultTransactionScopeManager extends TransactionScopeManager
Manages the transaction scoping using a Ebean thread local.
-
-
Constructor Summary
Constructors Constructor Description DefaultTransactionScopeManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the current Transaction from thread local scope (for implicit transactions).void
clearExternal()
Clears the current Transaction from thread local scope without any check for active transactions.SpiTransaction
getActive()
Return the current Transaction potentially looking in external scope (like Spring).SpiTransaction
getInScope()
Return the current Transaction from internal Ebean scope.void
register(TransactionManager manager)
Register the transaction manager (for use by external transaction scopes).void
replace(SpiTransaction trans)
Replace the current transaction with this one.void
set(SpiTransaction trans)
Set a new Transaction for this serverName and Thread.
-
-
-
Constructor Detail
-
DefaultTransactionScopeManager
public DefaultTransactionScopeManager()
-
-
Method Detail
-
register
public void register(TransactionManager manager)
Description copied from class:TransactionScopeManager
Register the transaction manager (for use by external transaction scopes).- Specified by:
register
in classTransactionScopeManager
-
getInScope
public SpiTransaction getInScope()
Description copied from class:TransactionScopeManager
Return the current Transaction from internal Ebean scope.- Specified by:
getInScope
in classTransactionScopeManager
-
getActive
public SpiTransaction getActive()
Description copied from class:TransactionScopeManager
Return the current Transaction potentially looking in external scope (like Spring).- Specified by:
getActive
in classTransactionScopeManager
-
replace
public void replace(SpiTransaction trans)
Description copied from class:TransactionScopeManager
Replace the current transaction with this one.Used for Background fetching and Nested transaction scopes.
Used for background fetching. Replaces the current transaction with a 'dummy' transaction. The current transaction is given to the background thread so it can continue the fetch.
- Specified by:
replace
in interfaceSpiTransactionScopeManager
- Specified by:
replace
in classTransactionScopeManager
-
set
public void set(SpiTransaction trans)
Description copied from class:TransactionScopeManager
Set a new Transaction for this serverName and Thread.- Specified by:
set
in classTransactionScopeManager
-
clear
public void clear()
Description copied from class:TransactionScopeManager
Clears the current Transaction from thread local scope (for implicit transactions).- Specified by:
clear
in classTransactionScopeManager
-
clearExternal
public void clearExternal()
Description copied from class:TransactionScopeManager
Clears the current Transaction from thread local scope without any check for active transactions. Intended for use with external transactions.- Specified by:
clearExternal
in classTransactionScopeManager
-
-