Class PlatformTransactionManagerAdapter

  • All Implemented Interfaces:
    javax.transaction.TransactionManager

    public final class PlatformTransactionManagerAdapter
    extends Object
    implements javax.transaction.TransactionManager
    Provides a light JTA TransactionManager based upon the PlatformTransactionManager 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.
    • Constructor Detail

      • PlatformTransactionManagerAdapter

        public PlatformTransactionManagerAdapter()
    • Method Detail

      • setPlatformTransactionManager

        public void setPlatformTransactionManager​(org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
      • getTransaction

        public javax.transaction.Transaction getTransaction()
                                                     throws javax.transaction.SystemException
        Specified by:
        getTransaction in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.SystemException
      • commit

        public void commit()
                    throws javax.transaction.HeuristicMixedException,
                           javax.transaction.HeuristicRollbackException,
                           IllegalStateException,
                           javax.transaction.RollbackException,
                           SecurityException,
                           javax.transaction.SystemException
        Specified by:
        commit in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.HeuristicMixedException
        javax.transaction.HeuristicRollbackException
        IllegalStateException
        javax.transaction.RollbackException
        SecurityException
        javax.transaction.SystemException
      • begin

        public void begin()
                   throws javax.transaction.NotSupportedException,
                          javax.transaction.SystemException
        Specified by:
        begin in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.NotSupportedException
        javax.transaction.SystemException
      • suspend

        public javax.transaction.Transaction suspend()
                                              throws javax.transaction.SystemException
        Specified by:
        suspend in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.SystemException
      • setTransactionTimeout

        public void setTransactionTimeout​(int seconds)
                                   throws javax.transaction.SystemException
        Specified by:
        setTransactionTimeout in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.SystemException
      • resume

        public void resume​(javax.transaction.Transaction tobj)
                    throws IllegalStateException,
                           javax.transaction.InvalidTransactionException,
                           javax.transaction.SystemException
        Specified by:
        resume in interface javax.transaction.TransactionManager
        Throws:
        IllegalStateException
        javax.transaction.InvalidTransactionException
        javax.transaction.SystemException
      • setRollbackOnly

        public void setRollbackOnly()
                             throws IllegalStateException,
                                    javax.transaction.SystemException
        Specified by:
        setRollbackOnly in interface javax.transaction.TransactionManager
        Throws:
        IllegalStateException
        javax.transaction.SystemException
      • getStatus

        public int getStatus()
                      throws javax.transaction.SystemException
        Specified by:
        getStatus in interface javax.transaction.TransactionManager
        Throws:
        javax.transaction.SystemException
      • addDataSource

        public void addDataSource​(DataSource ds)
      • commit

        public void commit​(org.springframework.transaction.TransactionStatus status)
      • rollback

        public void rollback​(org.springframework.transaction.TransactionStatus status)