-
1. Re: Is there a way to listen to Transaction?
ctomc May 3, 2013 4:44 PM (in response to howardl815)1 of 1 people found this helpfulYes it is possible and it is defined in EE spec.
take a look at http://docs.oracle.com/javaee/6/api/javax/ejb/AfterCompletion.html
but it all depends on what are you doing and how.
-
2. Re: Is there a way to listen to Transaction?
howardl815 May 3, 2013 5:11 PM (in response to ctomc)Thanks for the reply. We have some database inserts that we want to listen to, and if it successfully posts, then we'd like to send out a jms message to down stream systems. One question is we don't use any StatefulSession bean in our system, and it looks like I have to use a StatefulSession bean. Does implementing AfterCompletion require a transaction to be started FROM a stateful session bean? Or just create a stateful session bean that listens to transactions? Thank you very much.
-
3. Re: Is there a way to listen to Transaction?
r.reimann May 4, 2013 9:19 AM (in response to howardl815)1 of 1 people found this helpfulYou can use CDI transactional observers. See the links below for details:
http://docs.jboss.org/weld/reference/latest/en-US/html/events.html#d0e4008
-
4. Re: Is there a way to listen to Transaction?
howardl815 May 6, 2013 12:32 PM (in response to r.reimann)Thanks! This sounds like something we should look into. Thanks again.