Package org.teiid.spring.autoconfigure
Class PlatformTransactionManagerAdapter
- java.lang.Object
-
- org.teiid.spring.autoconfigure.PlatformTransactionManagerAdapter
-
- All Implemented Interfaces:
TransactionManager
public final class PlatformTransactionManagerAdapter extends Object implements TransactionManager
Provides a light JTA TransactionManager based upon thePlatformTransactionManager
This is the transaction manager that Teiid code sees. If no third party transaction manager found, but there are multiple data sources are defined, then this class will provide light weight JTA *like* functionality. Here in case of failure it is totally on the user to manually rollback any changes if any datasources failed to commit during the commit run. This transaction manager is best used when we are dealing with only 1 transactional resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlatformTransactionManagerAdapter.TransactionHolder
-
Constructor Summary
Constructors Constructor Description PlatformTransactionManagerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataSource(DataSource ds)
void
addDataSource(BaseConnectionFactory bean)
void
begin()
void
commit()
void
commit(org.springframework.transaction.TransactionStatus status)
PlatformTransactionManagerAdapter.TransactionHolder
getOrCreateTransaction(boolean start)
int
getStatus()
Transaction
getTransaction()
void
resume(Transaction tobj)
void
rollback()
void
rollback(org.springframework.transaction.TransactionStatus status)
void
setPlatformTransactionManager(org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
void
setRollbackOnly()
void
setTransactionTimeout(int seconds)
Transaction
suspend()
-
-
-
Method Detail
-
setPlatformTransactionManager
public void setPlatformTransactionManager(org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
-
getTransaction
public Transaction getTransaction() throws SystemException
- Specified by:
getTransaction
in interfaceTransactionManager
- Throws:
SystemException
-
getOrCreateTransaction
public PlatformTransactionManagerAdapter.TransactionHolder getOrCreateTransaction(boolean start)
-
rollback
public void rollback() throws IllegalStateException, SecurityException, SystemException
- Specified by:
rollback
in interfaceTransactionManager
- Throws:
IllegalStateException
SecurityException
SystemException
-
commit
public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException
- Specified by:
commit
in interfaceTransactionManager
- Throws:
HeuristicMixedException
HeuristicRollbackException
IllegalStateException
RollbackException
SecurityException
SystemException
-
begin
public void begin() throws NotSupportedException, SystemException
- Specified by:
begin
in interfaceTransactionManager
- Throws:
NotSupportedException
SystemException
-
suspend
public Transaction suspend() throws SystemException
- Specified by:
suspend
in interfaceTransactionManager
- Throws:
SystemException
-
setTransactionTimeout
public void setTransactionTimeout(int seconds) throws SystemException
- Specified by:
setTransactionTimeout
in interfaceTransactionManager
- Throws:
SystemException
-
resume
public void resume(Transaction tobj) throws IllegalStateException, InvalidTransactionException, SystemException
- Specified by:
resume
in interfaceTransactionManager
- Throws:
IllegalStateException
InvalidTransactionException
SystemException
-
setRollbackOnly
public void setRollbackOnly() throws IllegalStateException, SystemException
- Specified by:
setRollbackOnly
in interfaceTransactionManager
- Throws:
IllegalStateException
SystemException
-
getStatus
public int getStatus() throws SystemException
- Specified by:
getStatus
in interfaceTransactionManager
- Throws:
SystemException
-
addDataSource
public void addDataSource(DataSource ds)
-
addDataSource
public void addDataSource(BaseConnectionFactory bean)
-
commit
public void commit(org.springframework.transaction.TransactionStatus status)
-
rollback
public void rollback(org.springframework.transaction.TransactionStatus status)
-
-