Package org.teiid.dqp.internal.process
Class TransactionServerImpl
- java.lang.Object
-
- org.teiid.dqp.internal.process.TransactionServerImpl
-
- All Implemented Interfaces:
TransactionService
public class TransactionServerImpl extends Object implements TransactionService
Note that the begin methods do not leave the transaction associated with the calling thread. This is by design and requires explicit resumes for association.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TransactionServerImpl.TransactionMapping
-
Field Summary
Fields Modifier and Type Field Description protected TransactionManager
transactionManager
protected TransactionServerImpl.TransactionMapping
transactions
-
Constructor Summary
Constructors Constructor Description TransactionServerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransactionContext
begin(String threadId)
Local Transactionvoid
begin(TransactionContext context)
Request level transactionvoid
cancelTransactions(String threadId, boolean requestOnly)
void
commit(String threadId)
Local Transactionvoid
commit(String threadId, XidImpl xid, boolean onePhase, boolean singleTM)
Global Transactionvoid
commit(TransactionContext context)
Request level transactionvoid
end(String threadId, XidImpl xid, int flags, boolean singleTM)
Global Transactionvoid
forget(String threadId, XidImpl xid, boolean singleTM)
Global TransactionTransactionContext
getOrCreateTransactionContext(String threadId)
Collection<TransactionMetadata>
getTransactions()
boolean
isDetectTransactions()
int
prepare(String threadId, XidImpl xid, boolean singleTM)
Global TransactionXid[]
recover(int flag, boolean singleTM)
Global Transactionvoid
resume(TransactionContext context)
void
rollback(String threadId)
Local Transactionvoid
rollback(String threadId, XidImpl xid, boolean singleTM)
Global Transactionvoid
rollback(TransactionContext context)
Request level transactionvoid
setDetectTransactions(boolean detectTransactions)
void
setTransactionManager(TransactionManager transactionManager)
void
setXaImporter(XAImporter xaImporter)
void
start(String threadId, XidImpl xid, int flags, int timeout, boolean singleTM)
Global Transactionvoid
suspend(TransactionContext context)
void
terminateTransaction(String threadId)
-
-
-
Field Detail
-
transactions
protected TransactionServerImpl.TransactionMapping transactions
-
transactionManager
protected TransactionManager transactionManager
-
-
Method Detail
-
setDetectTransactions
public void setDetectTransactions(boolean detectTransactions)
-
isDetectTransactions
public boolean isDetectTransactions()
-
setXaImporter
public void setXaImporter(XAImporter xaImporter)
-
setTransactionManager
public void setTransactionManager(TransactionManager transactionManager)
-
prepare
public int prepare(String threadId, XidImpl xid, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
prepare
in interfaceTransactionService
- Throws:
XATransactionException
-
commit
public void commit(String threadId, XidImpl xid, boolean onePhase, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
commit
in interfaceTransactionService
- Throws:
XATransactionException
-
rollback
public void rollback(String threadId, XidImpl xid, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
rollback
in interfaceTransactionService
- Throws:
XATransactionException
-
recover
public Xid[] recover(int flag, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
recover
in interfaceTransactionService
- Throws:
XATransactionException
-
forget
public void forget(String threadId, XidImpl xid, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
forget
in interfaceTransactionService
- Throws:
XATransactionException
-
start
public void start(String threadId, XidImpl xid, int flags, int timeout, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
start
in interfaceTransactionService
- Throws:
XATransactionException
-
end
public void end(String threadId, XidImpl xid, int flags, boolean singleTM) throws XATransactionException
Global Transaction- Specified by:
end
in interfaceTransactionService
- Throws:
XATransactionException
-
suspend
public void suspend(TransactionContext context) throws XATransactionException
- Specified by:
suspend
in interfaceTransactionService
- Throws:
XATransactionException
-
resume
public void resume(TransactionContext context) throws XATransactionException
- Specified by:
resume
in interfaceTransactionService
- Throws:
XATransactionException
-
begin
public TransactionContext begin(String threadId) throws XATransactionException
Local Transaction- Specified by:
begin
in interfaceTransactionService
- Throws:
XATransactionException
-
commit
public void commit(String threadId) throws XATransactionException
Local Transaction- Specified by:
commit
in interfaceTransactionService
- Throws:
XATransactionException
-
rollback
public void rollback(String threadId) throws XATransactionException
Local Transaction- Specified by:
rollback
in interfaceTransactionService
- Throws:
XATransactionException
-
getOrCreateTransactionContext
public TransactionContext getOrCreateTransactionContext(String threadId)
- Specified by:
getOrCreateTransactionContext
in interfaceTransactionService
-
begin
public void begin(TransactionContext context) throws XATransactionException
Request level transaction- Specified by:
begin
in interfaceTransactionService
- Throws:
XATransactionException
-
commit
public void commit(TransactionContext context) throws XATransactionException
Request level transaction- Specified by:
commit
in interfaceTransactionService
- Throws:
XATransactionException
-
rollback
public void rollback(TransactionContext context) throws XATransactionException
Request level transaction- Specified by:
rollback
in interfaceTransactionService
- Throws:
XATransactionException
-
cancelTransactions
public void cancelTransactions(String threadId, boolean requestOnly) throws XATransactionException
- Specified by:
cancelTransactions
in interfaceTransactionService
- Throws:
XATransactionException
-
getTransactions
public Collection<TransactionMetadata> getTransactions()
- Specified by:
getTransactions
in interfaceTransactionService
-
terminateTransaction
public void terminateTransaction(String threadId) throws AdminException
- Specified by:
terminateTransaction
in interfaceTransactionService
- Throws:
AdminException
-
-