Calling a method on my entity bean that has a one to many relationship and I get the following:
13:52:53,225 INFO [STDOUT] Servlet error: java.lang.IllegalStateException: A CMR collection may only be used within the transction in which it was created
Any ideas? I have the dd set up for cmp and the method listed but I still get the error...
The error you see pretty much tells all.
What you probably do is something in your servlet:
a = getOneSideOfCmr();
b = a.getOtherSide();
There ist no transaction around it, so b is invalid.
Either surround this by a user transaction
or do the two calls within a method in a session bean.