[jboss-user] [JBoss Seam] - Re: ManyToMany association within conversation scope bean

avpavlov do-not-reply at jboss.com
Mon Dec 10 03:55:07 EST 2007


"pete.muir at jboss.org" wrote : ... hibernate is though in the persistence context?

I'm not sure I understand that :) Could you please clarify? Do you mean hibernate fetched collection to Provider bean and did not refresh when User form saved (== links changed)? If yes, why usernames were refreshed - these referenced from collection and refreshed properly.

I agree that probaly I'm wrong when blame Seam but there are a lot of annotations and I assumed that some combination (or simply missed) annotations lead to this side effect.

At the moment I "brute-forced" it :) - set event listener to post-ins/upd/del event, register provider form method as event observer and check for collections inconsistencies

  |   if (r instanceof User) {
  |             User u = (User)r;
  |             if (getProvider().getUsers().contains(u) != u.getProviders().contains(getProvider())) {
  |                 entityManager.refresh(getProvider());
  |             }
  |         }
  | 
It works but I'm sure there is better solution (at least not so "in-place").

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

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



More information about the jboss-user mailing list