Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [JBoss Seam] - Re: flushMode= MANUAL,
 when does commit happen? And other qu

scott.stark@jboss.org

2007-07-12


Hi DG!

Thank you very much for your informative input! In my original post, I was dealing with the creation of a new motherEntity (which is a complex process...). So the isNew flag would always be true....However the flag idea is good. I can set a completedOrCanceled flag. Initialize it as false. The @End methods can be like this:


|
| @End
| public void cancelMotherCreation(){
|  // at this point, the children collections may or may not have been filled,
|  // but it does not matter, since we can cascade....
|  entityManager.remove(motherEntity);
|  this.completedOrCanceled = true;
| }
|
| @End
| public void newMotherDone(){
|  entityManager.merge(motherEntity);
|  this.completedOrCanceled = true;
| }
|

Here the @Destroy method:


| @Destroy@(protected)
| public void destroy(){
|  if (this.completedOrCanceled == false)
|   entityManager.remove(motherEntity);
| }
|

I've got to try it out right now....


Regards,
Ellen

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063600
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.