Module eclipselink

Class JTATransactionController

    • Field Detail

      • defaultTransactionManager

        protected static jakarta.transaction.TransactionManager defaultTransactionManager
      • transactionManager

        protected jakarta.transaction.TransactionManager transactionManager
    • Constructor Detail

      • JTATransactionController

        public JTATransactionController()
        PUBLIC: Return a new controller for use with a JTA 1.0 compliant TransactionManager.
      • JTATransactionController

        public JTATransactionController​(jakarta.transaction.TransactionManager transactionManager)
        PUBLIC: Return a new controller for use with a JTA 1.0 compliant TransactionManager.
    • Method Detail

      • getTransactionKey_impl

        protected Object getTransactionKey_impl​(Object transaction)
                                         throws Exception
        INTERNAL: Return a key for the specified external transaction object. The key is just something that can be inserted into a hashtable (must support hashCode() and equals() methods).
        Specified by:
        getTransactionKey_impl in class AbstractTransactionController
        Parameters:
        transaction - The transaction to which the returned key applies (may be null)
        Returns:
        A key for the passed in transaction, or null if no transaction specified
        Throws:
        Exception
      • canBeginTransaction_impl

        protected boolean canBeginTransaction_impl​(Object status)
        INTERNAL: Return true if the status indicates that a transaction can be started. This would normally mean that no transaction is currently active.
        Specified by:
        canBeginTransaction_impl in class AbstractTransactionController
        Parameters:
        status - The current transaction status
        Returns:
        true if the current state allows for a transaction to be started
      • canCommitTransaction_impl

        protected boolean canCommitTransaction_impl​(Object status)
        INTERNAL: Return true if the status indicates that a transaction can be committed. This would normally mean that a transaction is currently active.
        Specified by:
        canCommitTransaction_impl in class AbstractTransactionController
        Parameters:
        status - The current transaction status
        Returns:
        true if the current state allows for a transaction to be committed
      • canRollbackTransaction_impl

        protected boolean canRollbackTransaction_impl​(Object status)
        INTERNAL: Return true if the status indicates that a transaction can be rolled back. This would normally mean that a transaction is currently active.
        Specified by:
        canRollbackTransaction_impl in class AbstractTransactionController
        Parameters:
        status - The current transaction status
        Returns:
        true if the current state allows for a transaction to be rolled back
      • canIssueSQLToDatabase_impl

        protected boolean canIssueSQLToDatabase_impl​(Object status)
        INTERNAL: Return true if the status indicates that the SQL should be issued to the db. This would normally mean that a transaction was active.
        Specified by:
        canIssueSQLToDatabase_impl in class AbstractTransactionController
        Parameters:
        status - The current transaction status
        Returns:
        true if the current state allows for the SQL to be sent to the database
      • canMergeUnitOfWork_impl

        protected boolean canMergeUnitOfWork_impl​(Object status)
        INTERNAL: Return true if the status indicates that the unit of work should be merged into the shared cache. This would normally mean that the transaction was committed successfully.
        Specified by:
        canMergeUnitOfWork_impl in class AbstractTransactionController
        Parameters:
        status - The current transaction status
        Returns:
        true if the current state dictates that the unit of work should be merged
      • acquireTransactionManager

        protected jakarta.transaction.TransactionManager acquireTransactionManager()
                                                                            throws Exception
        INTERNAL: Obtain and return the JTA TransactionManager on this platform. By default try java:comp JNDI lookup. This method can be can be overridden by subclasses to obtain the transaction manager by whatever means is appropriate to the server. This method is invoked by the constructor to initialize the transaction manager at instance-creation time. Alternatively the transaction manager can be set directly on the controller instance using the setTransactionManager() method after the instance has been created.
        Returns:
        The TransactionManager for the transaction system
        Throws:
        Exception
      • getIntStatus

        protected int getIntStatus​(Object status)
        INTERNAL: Convenience method to return the int value of the transaction status. Assumes that the status object is an Integer.
      • getTransactionManager

        public jakarta.transaction.TransactionManager getTransactionManager()
        PUBLIC: Return the transaction manager used to control the JTA transactions.
        Returns:
        The JTA TransactionManager that is used to obtain transaction state information and control the active transaction.
      • setTransactionManager

        public void setTransactionManager​(jakarta.transaction.TransactionManager mgr)
        PUBLIC: Set the transaction manager used to control the JTA transactions.
        Parameters:
        mgr - A valid JTA TransactionManager that can be accessed by this controller to obtain transaction state information and control the active transaction.
      • getDefaultTransactionManager

        public static jakarta.transaction.TransactionManager getDefaultTransactionManager()
      • setDefaultTransactionManager

        public static void setDefaultTransactionManager​(jakarta.transaction.TransactionManager defaultTransactionManager)
        PUBLIC: Set the JTA transaction manager to be used. This can be called directly before login to configure JTA integration manually, or using Spring injection.