Have u returned the collection of CMR field (means collection of local interfaces) outside the bean where u have defined this relationship
I hade the same problem where i called the abstract CMR method inside the session bean and tried to manupulate the collection of the local interfaces returned by the CMR abstract method
Yes. I'm iterating over the relation inside session ejb,
and next from each result I'm acquiring value objects
and if it's needed also any other related ejbs.
Anyway if this a problem cause, I think that this behaviour is incorrect. ?????
The problem is you are having is caused by getting an iterator in one transaction (or no transaction) and using it in another. This behavior and exception are required by the EJB 2.0 specification.
I found the very simple solution for this.
When I want to get all CMR related ejbs
I'm not using a collection but simple array:
Object tasks_array = testEJBLocal.getTasks().toArray();
next I'm iterating over this array insted of collection and everything is working fine.
This is a common solution. I usually create a new ArrayList with the relationship collection to get a snapshot. Something like this:
ArrayList snapshot = new ArrayList(testEJBLocal.getTasks());