[Resin-interest] Can user threads call ejb methods?

2009-06-02 Thread Jeff Schnitzer
Is there a problem calling ejb methods from user-started threads
inside the resin container?  Yes, I know the ejb spec says that
applications shouldn't start threads, but part of the spec is lame.

The SubEtha mailing list server relies on an SMTP processing library
which starts its own threads and then makes callbacks into our
handlers as the email arrives.  These handlers call into an ejb which
processes the message in a transaction.

We're seeing some really bizarre behavior where sometimes there is a
transaction and sometimes there isn't.  Could this be because the call
is being done on a non-resin-started thread?  If so, is there any
workaround?

Thanks,
Jeff


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Can user threads call ejb methods?

2009-06-02 Thread Jeff Schnitzer
Nevermind, the problem was something else.  Calling a find() method on
an EntityManager outside of a transaction scope, then calling an EJB
which has a transaction scope causes all manner of havoc when the EJB
tries to write to the database.

Jeff

On Tue, Jun 2, 2009 at 5:33 PM, Jeff Schnitzer j...@infohazard.org wrote:
 Is there a problem calling ejb methods from user-started threads
 inside the resin container?  Yes, I know the ejb spec says that
 applications shouldn't start threads, but part of the spec is lame.

 The SubEtha mailing list server relies on an SMTP processing library
 which starts its own threads and then makes callbacks into our
 handlers as the email arrives.  These handlers call into an ejb which
 processes the message in a transaction.

 We're seeing some really bizarre behavior where sometimes there is a
 transaction and sometimes there isn't.  Could this be because the call
 is being done on a non-resin-started thread?  If so, is there any
 workaround?

 Thanks,
 Jeff



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest