public class EntityTransactionImpl extends Object
EntityTransactionImpl
,
The EntityTransaction is a thin wrapper around a UnitOFWork.
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected boolean |
rollbackOnly |
protected EntityTransactionWrapper |
wrapper |
Constructor and Description |
---|
EntityTransactionImpl(EntityTransactionWrapper wrapper) |
Modifier and Type | Method and Description |
---|---|
void |
begin()
Start the current transaction.
|
void |
commit()
Commit the current transaction, writing any un-flushed changes to the database.
|
protected void |
finalize()
Here incase a user does not commit or rollback an enityTransaction but just
throws it away.
|
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 EntityTransactionWrapper wrapper
protected boolean active
protected boolean rollbackOnly
public EntityTransactionImpl(EntityTransactionWrapper wrapper)
public void begin()
isActive()
returns
false
.IllegalStateException
- if isActive() is true.public void commit()
isActive()
returns true
.IllegalStateException
- if isActive() is false.public void rollback()
isActive()
returns
true
.IllegalStateException
- if isActive() is false.public void setRollbackOnly()
IllegalStateException
- if isActive() is false.protected void finalize() throws Throwable
public boolean getRollbackOnly()
IllegalStateException
- if isActive() is false.public boolean isActive()
Copyright © 2022. All rights reserved.