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 ?
Solved the root cause of the problem by using read-only for get* and commit option A.