[jboss-user] [EJB 3.0] - Re: Entity bean @Post... lifecycle methods that call SLSB ha

jaikiran do-not-reply at jboss.com
Tue Oct 14 11:22:16 EDT 2008


I am not an expert at this, but i think this is what is happening:

- SLSB calls some method with transaction T1. In this T1 transaction, the entity is inserted/updated (but not yet commited because the transaction is not complete). During this flow, the @PostUpdate lifecycle method is called in the same transaction context T1. 

- Now this @PostUpdate lifecycle method calls a SLSB method probably which has the @RequiresNew transaction attribute. As a result a new transaction T2 is created and in this T2 transaction context the SLSB issues a select statement on the same entity.

Since these 2 queries are being fired from 2 different transaction contexts (remember that the transaction T1 is not yet committed), this probably is resulting in this issue. 

You could try changing the transaction attribute of the second SLSB method to @Required and see if it fixes the problem. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182173#4182173

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182173



More information about the jboss-user mailing list