Parece que vc está usando EJB 2.0 CMR, porém seu ejb (UserEJB) deveria ter um campo
private Collection group;

e quatro metodos:

public Collection getGroups(){ return this.group;}
public void setGroups(Collection newGroup){ this.group = new ArrayList(newGroup);}
public void addGroup(Group group) { this.group.add(group);}

a chamada então deveria ser:

user.addGroup(group);

e não user.getGroups().add(group);

A documentação da Resin deve ser errado.

Sven

Maykel Tres wrote:
007401c1c614$cf5e64c0$[EMAIL PROTECTED]">
Ola pessoal,
 
alguém já teve o problema abaixo:
 
java.lang.IllegalStateException: Persistent collection updates need to
occur in the same transaction as the collection was obtained. Either:
1. put the update in an EJB business method, or
2. wrap a UserTransaction around the access, or
3. use the UserTransactionFilter to protect the entire servlet.
at com.caucho.persist.PersistentList.transactionMismatch(PersistentList.java:269)
at _ejb.surya.corporateboss.ejb.UserBean__QPersist$_caucho_groups__class.add(UserBean__QPersist.java:433)
at java.util.AbstractList.add(AbstractList.java:87)
at _teste__jsp._jspService(/portal/teste.jsp:37)
at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
at com.caucho.jsp.Page.subservice(Page.java:485)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:179)
at com.caucho.server.http.Invocation.service(Invocation.java:288)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:132)
at com.cauch o.server.http.ServletServer.serviceTop(ServletServer.java:937)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
tive esse erro quando executei:
user.getGroups().add(group);
na documentação do Resin ele mostra fazer dessa forma. 
se alguém tiver alguma idéia de como faço pra resolver esse problema ficarei muito grato!
Maykel



Responder a