[jboss-user] [JBoss Seam] - SMPC and forcing a transaction to commit

SmokingAPipe do-not-reply at jboss.com
Fri Feb 9 01:30:07 EST 2007

Here's the situation: I have a Seam SFSB which creates an entity and persists it.  It does this using a SMPC.  The method that does the persisting also sends the same entity to a message driven bean (MDB) on this same server.  The MDB needs this entity to be attached so it can look at various fields in the entity.

Here's the problem: The transaction from the seam-side, which sends the message, does not commit until the method ends (returns).  But the MDB is picking up the message before that happens, so the MDB is seeing the entity before it has been committed.

This means that it can't find the entity and it's acting as an unattached entity.  This is bad.  I can work around it by treating it as an unattached entity but I would prefer to be able to use it attached.

Is there a solution for this?  I would really like to mark my Seam SFSB method with some annotation that says, "let me handle the transaction on this one".  I saw the @Transactional annotation, which says "method invocations should take place in a transaction, and if no transaction exists when the method is called, a transaction will be started just for that method", which is exactly what I don't want.


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

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

More information about the jboss-user mailing list