users@glassfish.java.net

Re: Looking up JMS / Database resource in EJB 3.1 entity listener

From: <glassfish_at_javadesktop.org>
Date: Mon, 09 Aug 2010 13:30:53 PDT

Just FYI, you will want to be very careful doing work in Entity listeners. We've just had all sorts of issues doing work with Entity listeners. Notably for JMS, is that the transaction state seems to be a bit "muddy". You also don't want to do any JPA work within a Listener.

We inevitably set up internal queues (i.e. not JMS) to handle all of our traffic generated within Entity Listeners, with a timer job that consumes the events and does whatever it wants with them. Just seems safer and more stable for us.
[Message sent by forum member 'whartung']

http://forums.java.net/jive/thread.jspa?messageID=479726