[jboss-user] [EJB] - CMR Collections and transaction demarcation

smith.gerry@gmail.com do-not-reply at jboss.com
Wed Oct 14 08:18:43 EDT 2009


I am using JBoss 4.2.1, EJB 2.1.
I have a session bean which uses a finder to get a collection of entities and creates a list of data transfer objects. The entities have CMR Collections that need to be accessed.
I am trying to make this work without a transaction, and I'm using XDoclet, so I've used @ejb.transaction type="NotSupported" for the session bean, and @ejb.transaction type="Supports" for the entity beans - the one with finder and also the ones in the CMR Collections.

I'm getting this exception:
 java.lang.IllegalStateException: A CMR collection may only be used within the transction in which it was created

Does this mean that you have to be in a transaction when you access a CMR transaction, or am I doing something wrong ?

(The session bean is called by another session bean which has the default 'required' transaction type, in case that makes a difference).

Would this happen in Jboss 5 as well ?

Many thanks,

Gerry

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

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



More information about the jboss-user mailing list