Class NonTxEmCloser


  • public class NonTxEmCloser
    extends Object
    Close the non tx invocations on transaction scoped entity manager
    Author:
    Scott Marlow
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.wildfly.common.function.ThreadLocalStack<Map<String,​javax.persistence.EntityManager>> nonTxStack
      Each thread will have its own list of SB invocations in progress.
    • Constructor Summary

      Constructors 
      Constructor Description
      NonTxEmCloser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void add​(String puScopedName, javax.persistence.EntityManager entityManager)  
      static javax.persistence.EntityManager get​(String puScopedName)
      Return the transactional entity manager for the specified scoped persistence unit name
      static void popCall()
      current session bean invocation is ending, close any transactional entity managers created without a Jakarta Transactions transaction.
      static void pushCall()
      entered new session bean invocation, start new collection for tracking transactional entity managers created without a Jakarta Transactions transaction.
    • Field Detail

      • nonTxStack

        public static final org.wildfly.common.function.ThreadLocalStack<Map<String,​javax.persistence.EntityManager>> nonTxStack
        Each thread will have its own list of SB invocations in progress. Key = scoped persistence unit name
    • Constructor Detail

      • NonTxEmCloser

        public NonTxEmCloser()
    • Method Detail

      • pushCall

        public static void pushCall()
        entered new session bean invocation, start new collection for tracking transactional entity managers created without a Jakarta Transactions transaction.
      • popCall

        public static void popCall()
        current session bean invocation is ending, close any transactional entity managers created without a Jakarta Transactions transaction.
      • get

        public static javax.persistence.EntityManager get​(String puScopedName)
        Return the transactional entity manager for the specified scoped persistence unit name
        Parameters:
        puScopedName -
        Returns:
      • add

        public static void add​(String puScopedName,
                               javax.persistence.EntityManager entityManager)