[jboss-user] [EJB 3.0] - Re: @TransactionAttribute problem with local invocation

jaikiran do-not-reply at jboss.com
Mon Jul 20 10:54:13 EDT 2009


public void saveAllPerson(){
  |      while(true){
  |         savePerson();
  |      }
  |   }
  | 

Calling savePerson from saveAllPerson results in a plain java invocation and you won't see any EJB semantics. You need to get hold of the EJB business object and then invoke the savePerson on that business object to get the EJB semantics:

@Resource
  | private SessionContext sessCtx;
  | 
  | public void saveAllPerson(){
  |     // get business object
  |     MyBusinessInterface bean = this.sessCtx.getBusinessObject(MyBusinessInterface.class);
  |      while(true){
  |       bean.savePerson();
  |      }
  |   }
  | 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244671#4244671

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244671



More information about the jboss-user mailing list