RE: EntityBean Events inside tx.
Firstly, I wanted to thank the list for all the responses I had. But, the problem is that the suggested solutions involve using 'Transacted JMS' services. I have not been able to make JMS aware of the transacions it is running on. Messages always get sent, inspite of eventual rollbacks. I only wanted to know if anyone got this working under Orion 1.4.7 Thanks in advance Ramiro Diaz Trepat Opetra "Day, Jem BGI WAC" <[EMAIL PROTECTED]To: Orion-Interest <[EMAIL PROTECTED]> m>cc: Sent by: Subject: RE: EntityBean Events inside tx. owner-orion-interest@orion server.com 03/04/2001 02:21 p.m. Please respond to Orion-Interest Here's a description of an implementation of the Observer pattern for EJB. http://www.theserverside.com/resources/ObserverPattern.jsp An alternative is to implement your 'Change Events' as JMS messages, if you are using 'Transacted JMS' messages are only 'published' when the encompassing Tx is committed. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 03, 2001 8:25 AM > To: Orion-Interest > Subject: EntityBean Events inside tx. > > > We would like our entity beans to propagate events in the same > fashion than regular java beans. > Therefore we must, for example, send events notifying of property > changes inside the bean. The problem with this is that we don't know > if this method was called inside a transaction that might be > rolled back later on, and hence the property change event > should not have been sent at all. > Clearly, we want to propagate the events only when the transactions > are commited. > Is there a standard "pattern" to manage this sort of thing ? > TIA > > Ramiro Diaz Trepat > Opetra > >
Re: EntityBean Events inside tx.
You can try using JMS (colas), JMS puede participar en la transaccion, si la transaccion es rolledback, entonces el mensaje no se envia. Dependiendo de la lana que tengas... puedes comprar SonicMQ, el cual es muy caro y bueno, o puedes usar un open source. Algunos son spyderMQ (www.jboss.org) o OpenJMS (www.exolab.org). En la siguiente version de EJB, ya existe un message-driven Bean que tambien puede ser util. Por cierto, jboss ya lo tiene implementado. Saludos y espero que esto te ayude, JC :-) --- [EMAIL PROTECTED] wrote: > We would like our entity beans to propagate events > in the same > fashion than regular java beans. > Therefore we must, for example, send events > notifying of property > changes inside the bean. The problem with this is > that we don't know > if this method was called inside a transaction that > might be > rolled back later on, and hence the property change > event > should not have been sent at all. > Clearly, we want to propagate the events only when > the transactions > are commited. > Is there a standard "pattern" to manage this sort of > thing ? > TIA > > Ramiro Diaz Trepat > Opetra > > __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
RE: EntityBean Events inside tx.
Here's a description of an implementation of the Observer pattern for EJB. http://www.theserverside.com/resources/ObserverPattern.jsp An alternative is to implement your 'Change Events' as JMS messages, if you are using 'Transacted JMS' messages are only 'published' when the encompassing Tx is committed. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 03, 2001 8:25 AM > To: Orion-Interest > Subject: EntityBean Events inside tx. > > > We would like our entity beans to propagate events in the same > fashion than regular java beans. > Therefore we must, for example, send events notifying of property > changes inside the bean. The problem with this is that we don't know > if this method was called inside a transaction that might be > rolled back later on, and hence the property change event > should not have been sent at all. > Clearly, we want to propagate the events only when the transactions > are commited. > Is there a standard "pattern" to manage this sort of thing ? > TIA > > Ramiro Diaz Trepat > Opetra > >
RE: EntityBean Events inside tx.
You could wrap your whole process under a session bean and let the session bean to fire events for you based on your transaction outcome. A session bean implemented interface SessionSynchronization will be notified when transaction is commited or aborted. Conrad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 8:25 AM To: Orion-Interest Subject: EntityBean Events inside tx. We would like our entity beans to propagate events in the same fashion than regular java beans. Therefore we must, for example, send events notifying of property changes inside the bean. The problem with this is that we don't know if this method was called inside a transaction that might be rolled back later on, and hence the property change event should not have been sent at all. Clearly, we want to propagate the events only when the transactions are commited. Is there a standard "pattern" to manage this sort of thing ? TIA Ramiro Diaz Trepat Opetra