Status: Resolved (View Workflow)
Affects Version/s: EJB3_1 1.0.7
Component Fix Version(s):1.0.0-alpha-25
Similar Issues:Show 10 results
EJBTHREE-2223 Singleton postConstruct must run with RequiresNew transaction semantics EJBTHREE-141 Stateful session PostConstruct missing transaction, security contexts EJBTHREE-2091 Singleton EJBs do not honor @LocalBinding EJBTHREE-2272 @Startup @Singleton beans can not call protected EJBs EJBTHREE-448 Incorrect package of PostConstruct and PreDestroy annotations EJBTHREE-1738 Security, transaction contexts broken in start() method of @Service beans EJBTHREE-2236 NullPointerException in CMTTxInterceptor.mandatory() method when invoked on a lifecycle callback method EJBTHREE-2106 @Singleton crashes with no-interface bean EJBTHREE-2093 Log the jndi names to which the singleton bean's views are being bound EJBTHREE-2084 Implement @DependsOn for singleton beans
The EJB3.1 spec states:
4.8.3 Transaction Semantics of Initialization and Destruction
PostConstruct and PreDestroy methods of Singletons with container-managed transactions are transac-
tional. From the bean developer's view there is no client of a PostConstruct or PreDestroy method.
A PostConstruct or PreDestroy method of a Singleton with container-managed transactions has transac-
tion attribute REQUIRED, REQUIRES_NEW, or NOT_SUPPORTED (Required , RequiresNew, or
NotSupported if the deployment descriptor is used to specify the transaction attribute).
Note that the container must start a new transaction if the REQUIRED (Required) transaction
attribute is used. This guarantees, for example, that the transactional behavior of the PostConstruct
method is the same regardless of whether it is initialized eagerly at container startup time or as a side
effect of a first client invocation on the Singleton. The REQUIRED transaction attribute value is
allowed so that specification of a transaction attribute for the Singleton PostConstruct/PreDestroy
methods can be defaulted.
However, the current implementation of singleton (1.0.0-alpha-2) does not run the postconstruct and predestroy methods in a transaction context.