I obtain a collection of related records via CMR and then I try adding an entity to that collection and I recieve the following error from JBoss:
javax.ejb.EJBException: This collection is a read-only snapshot
at this following line:
cmrCollection.add(entityLocalInterface);
I've also tried taking out my read-only xdoclet tags for the get* methods but then I run into transactional exceptions.
Can anyone point me in the right direction as to how to properly add entity beans via CMR?
Thanks in advance
-
Adding Entity beans via CMR (1 messages)
- Posted by: mark greene
- Posted on: January 27 2004 17:19 EST
Threaded Messages (1)
- Adding Entity beans via CMR by sergiu truta on January 28 2004 05:44 EST
-
Adding Entity beans via CMR[ Go to top ]
- Posted by: sergiu truta
- Posted on: January 28 2004 05:44 EST
- in response to mark greene
Read the objects from the returned collection and create a new one into which you can insert any other objects you like.
Let me tell you that if your query returns a collection of entities you cannot return that collection to the client, you should instead create a new collection of DTOs (the Data Transfer Object pattern), each DTO corresponding to an entity and return to the client the new collection.