Mantis - Resin
Viewing Issue Advanced Details
4186 major always 08-23-10 11:18 11-11-10 11:11
reza  
ferg  
high  
closed 4.0.10  
fixed  
none    
none 4.0.13  
0004186: Life-cycle call-back methods should be transactional
Life-cycle call-back methods (@PostConstruct/@PreDestroy) should be transactional and support transaction meta-data including BMT meta-data as well as EJB session context transaction related methods. This is especially true for Singletons and is a requirement of the EJB 3.1 specification. This should probably be extended to CDI managed beans targeted for Java EE 7.

Here is an example:

@Singleton
public class SomeBean {

  @PostConstruct
  private void init()
  {
    // Should be in a CMT REQUIRED transaction by default.
  }

  public void doSomething()
  {
    // Should be in a CMT REQUIRED transaction by default.
  }

  @PreDestroy
  private void destroy()
  {
    // Should be in a CMT REQUIRED transaction by default.
  }
}

There are no notes attached to this issue.