Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

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

scott.stark@jboss.org

2007-07-17


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.