public final class PlatformTransactionManagerAdapter extends Object implements TransactionManager
PlatformTransactionManager
This is the transaction manager that Teiid
code sees.
Notes: If a third party transaction manager is found, but data sources
defined are not XA capable then default Spring behavior continued, which
means the data sources are not co-ordinated in a transaction at all. If they
are XA sources then JTA transaction semantics will take over.
If no third party transaction manager found, but there are multiple data
sources are defined, then this class will provide lite 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 2
sources, especially one of them is readonly.Constructor and Description |
---|
PlatformTransactionManagerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
addDataSource(BaseConnectionFactory bean) |
void |
addDataSource(DataSource ds) |
void |
begin() |
void |
commit() |
int |
getStatus() |
Transaction |
getTransaction() |
void |
resume(Transaction tobj) |
void |
rollback() |
void |
setJTATransactionManager(TransactionManager txnManager) |
void |
setPlatformTransactionManager(org.springframework.transaction.PlatformTransactionManager platformTransactionManager) |
void |
setRollbackOnly() |
void |
setTransactionTimeout(int seconds) |
Transaction |
suspend() |
public void setPlatformTransactionManager(org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
public void setJTATransactionManager(TransactionManager txnManager)
public Transaction getTransaction() throws SystemException
getTransaction
in interface TransactionManager
SystemException
public void rollback() throws IllegalStateException, SecurityException, SystemException
rollback
in interface TransactionManager
IllegalStateException
SecurityException
SystemException
public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException
commit
in interface TransactionManager
HeuristicMixedException
HeuristicRollbackException
IllegalStateException
RollbackException
SecurityException
SystemException
public void begin() throws NotSupportedException, SystemException
begin
in interface TransactionManager
NotSupportedException
SystemException
public Transaction suspend() throws SystemException
suspend
in interface TransactionManager
SystemException
public void setTransactionTimeout(int seconds) throws SystemException
setTransactionTimeout
in interface TransactionManager
SystemException
public void resume(Transaction tobj) throws IllegalStateException, InvalidTransactionException, SystemException
resume
in interface TransactionManager
IllegalStateException
InvalidTransactionException
SystemException
public void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface TransactionManager
IllegalStateException
SystemException
public int getStatus() throws SystemException
getStatus
in interface TransactionManager
SystemException
public void addDataSource(DataSource ds)
public void addDataSource(BaseConnectionFactory bean)
Copyright © 2019. All rights reserved.