public class JTAUserTransactionAdapter extends Object implements TransactionManagerAdapter
Modifier and Type | Field and Description |
---|---|
protected TransactionManager |
mgr |
Constructor and Description |
---|
JTAUserTransactionAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
begin()
Create a new transaction and associate it with
the current thread.
|
Transaction |
beginSuspending() |
void |
commit()
Complete the transaction associated with the
current thread.
|
int |
getStatus()
Obtain the status of the transaction associated
with the current thread.
|
void |
resume(Transaction transaction) |
void |
rollback()
Roll back the transaction associated with the
current thread.
|
void |
setRollbackOnly()
Modify the transaction associated with the current
thread such that the only possible outcome of the
transaction is to roll back the transaction.
|
void |
setTransactionTimeout(int seconds)
Modify the value of the timeout value that is
associated with the transactions started by the
current thread with the begin method.
|
protected TransactionManager mgr
public void begin() throws TransactionManagementException
TransactionManagerAdapter
begin
in interface TransactionManagerAdapter
TransactionManagementException
public Transaction beginSuspending() throws TransactionManagementException
TransactionManagementException
public void resume(Transaction transaction)
public void commit() throws TransactionManagementException
TransactionManagerAdapter
commit
in interface TransactionManagerAdapter
TransactionManagementException
public void rollback() throws TransactionManagementException
TransactionManagerAdapter
rollback
in interface TransactionManagerAdapter
TransactionManagementException
public int getStatus() throws TransactionManagementException
TransactionManagerAdapter
getStatus
in interface TransactionManagerAdapter
TransactionManagementException
public void setRollbackOnly() throws TransactionManagementException
TransactionManagerAdapter
setRollbackOnly
in interface TransactionManagerAdapter
TransactionManagementException
public void setTransactionTimeout(int seconds) throws TransactionManagementException
TransactionManagerAdapter
setTransactionTimeout
in interface TransactionManagerAdapter
seconds
- seconds - The value of the timeout
in seconds. If the value is zero, the transaction
service restores the default value.TransactionManagementException
Copyright © 2017 The Apache Software Foundation. All rights reserved.