public class EntityTransactionImpl
extends java.lang.Object
EntityTransactionImpl| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active |
protected org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.TransactionFinalizer |
finalizer |
static boolean |
isFinalizedRequired
PERF: Avoid finalization if not required by the application, and finalizers have major concurrency affects.
|
protected java.util.WeakHashMap<QueryImpl,QueryImpl> |
openQueriesMap
Keep a weak reference to the open queries that are executed in this entity manager.
|
protected boolean |
rollbackOnly |
protected EntityTransactionWrapper |
wrapper |
| Constructor and Description |
|---|
EntityTransactionImpl(EntityTransactionWrapper wrapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOpenQuery(QueryImpl query)
Queries that leave the connection and are executed against this entity
manager will be added here.
|
void |
begin()
Start the current transaction.
|
protected void |
closeOpenQueries()
Open queries within a transaction will be closed on commit or rollback
if they haven't already been closed.
|
void |
commit()
Commit the current transaction, writing any un-flushed changes to the
database.
|
protected java.util.Map<QueryImpl,QueryImpl> |
getOpenQueriesMap()
Return the weak reference to the open queries.
|
boolean |
getRollbackOnly()
Determine whether the current transaction has been marked for rollback.
|
boolean |
isActive()
Check to see if the current transaction is in progress.
|
void |
rollback()
Roll back the current transaction, discarding any changes that have
happened in this transaction.
|
void |
setRollbackOnly()
Mark the current transaction so that the only possible outcome of the
transaction is for the transaction to be rolled back.
|
protected java.util.WeakHashMap<QueryImpl,QueryImpl> openQueriesMap
protected EntityTransactionWrapper wrapper
protected boolean active
protected boolean rollbackOnly
protected org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.TransactionFinalizer finalizer
public static boolean isFinalizedRequired
public EntityTransactionImpl(EntityTransactionWrapper wrapper)
public void addOpenQuery(QueryImpl query)
query - public void begin()
isActive() returns false.java.lang.IllegalStateException - if isActive() is true.protected void closeOpenQueries()
public void commit()
isActive() returns
true.java.lang.IllegalStateException - if isActive() is false.public void rollback()
isActive() returns true.java.lang.IllegalStateException - if isActive() is false.public void setRollbackOnly()
java.lang.IllegalStateException - if isActive() is false.protected java.util.Map<QueryImpl,QueryImpl> getOpenQueriesMap()
public boolean getRollbackOnly()
java.lang.IllegalStateException - if isActive() is false.public boolean isActive()