[jboss-user] [EJB 3.0] - Re: Problem with Threads and Transactional context

bill.burke@jboss.com do-not-reply at jboss.com
Tue Jul 17 14:39:12 EDT 2007


You can pass this pointers around of EJBs and expect transactions to work.  This is because EJBs have a container that sits in front of bean instances so that it can handle things like transaction bounders.

You should instead do:


  | @Resource SessionContext ctx;
  | 
  | 
  | public void processar(...)
  | {
  |    TempoRealRN thisPtr = ctx.getBusinessInterface(TempoRealFN.class);
  |    CorFrente = new ThreadCorFrente(controladorComum, this, log, dto, nomeThreadFrente, grupoFrente);
  |    tCorFrente.addObserver(this);
  |    tCorFrente.start();
  | }
  | 
  | 

You'll also have to have TempoRealFN extend the Observer interface probably.

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

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



More information about the jboss-user mailing list