[jboss-user] [JBoss Seam] - Re: failed to lazily initialize a collection

quilian do-not-reply at jboss.com
Thu Apr 26 06:33:13 EDT 2007


"petemuir" wrote : Yes, use a SMPC, not an extended PC.  You don't want the @Transactional on those methods (it's an entity bean), and you probably want to let hibernate take care up updating the relationship for you - call entityManager.refresh(foo) to get hibernate to do this.

I now tried to do the refreshing but had no luck. I stumpled acrross several Forum posts taht cite the following from the EJB 3.0 specs:
anonymous wrote : 
  | Note that it is the application that bears responsibility for maintaining the consistency of runtime
  | relationships?for example, for insuring that the ?one? and the ?many? sides of a bidirectional
  | relationship are consistent with one another when the application updates the
  | relationship at runtime.
  | 

Doesnt that mean i should do those gruppe.add/remove calls in Benutzer.setGruppe() ???

Greetings,
Tobias


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040912#4040912

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040912



More information about the jboss-user mailing list