Package com.cmobilecom.af.model.phase
Interface Transaction
-
- All Known Implementing Classes:
JTATransaction
,ResourceLocalTransaction
public interface Transaction
Transaction: resource local or JTA.- Since:
- 5.9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
begin(boolean join)
Begin a new transaction or join current transaction.void
commit()
Commit current transaction.DataAccessUnit
getDataAccessUnit()
Get the DataAccessUnit of associated persistence unit.boolean
isActive()
Is current transaction active?void
rollback()
Rollback current transaction.void
setDataAccessUnit(DataAccessUnit dataAccessUnit)
Change dataAccessUnit.void
setTransactionTimeout(int timeout)
Set transaction timeout.
-
-
-
Method Detail
-
commit
void commit() throws SystemException
Commit current transaction.- Throws:
SystemException
- throw if an error occurs
-
rollback
void rollback() throws SystemException
Rollback current transaction.- Throws:
SystemException
- throw if an error occurs
-
begin
void begin(boolean join) throws SystemException
Begin a new transaction or join current transaction. Beginning a new transaction will commit current transaction.- Parameters:
join
- whether to join current transaction- Throws:
SystemException
- throw if an error occurs
-
setTransactionTimeout
void setTransactionTimeout(int timeout)
Set transaction timeout. Timeout without activities.- Parameters:
timeout
- timeout in milliseconds
-
isActive
boolean isActive()
Is current transaction active?- Returns:
- true if active, false otherwise
-
getDataAccessUnit
DataAccessUnit getDataAccessUnit()
Get the DataAccessUnit of associated persistence unit.- Returns:
- DataAccessUnit object. return null for JTA.
- Since:
- 5.13
-
setDataAccessUnit
void setDataAccessUnit(DataAccessUnit dataAccessUnit) throws SystemException
Change dataAccessUnit. Ignored for JTA.If current transaction is active, commit it and start a new transaction for the new dataAccessUnit.
- Parameters:
dataAccessUnit
- instance type or instance.- Throws:
SystemException
- throw if an error occurs
-
-