I am doing something that doesn't seem to fit too well with the framework. I 
have a set of user edit pages. I wanted to let the user go to a few popup 
windows to edit certain areas of the user's data. Then when the user decides 
the changes are good, commit them all at the same time.

That basic premise is working, what I am running into is a problem with trying 
to have multiple "save points". I was trying to make it so in each popup, the 
user would be able to click apply or cancel. The apply would apply all the 
changes on the popup to the object, and the cancel to rollback the changes for 
that popup only.  Each popup controls not only single properties (username, 
first name, etc.), but may also contain lists (phone numbers, etc.). So when 
canceling the dialog, it may be adds and deletes of children that I want to 
undo. 

I tried using a clone via object i/o stream to implement this, but the clones 
were not happy with hibernate/ejb3:
org.hibernate.LazyInitializationException: failed to lazily initialize a 
collection of role: mypackage.User.emails, no session or session was closed

Is there a "clean" way of doing this? I wanted to have these multiple save 
points as the user may be new and cannot be saved until all the information is 
complete. 

Is there some way to nest transactions, create save points in a transaction, or 
somehow clone objects with the EntityManager that I missed (I can't use refresh 
as that would rollback all my changes, not just one popup's worth)?

If I can't get this to work, I will just remove the popup cancel/rollback 
functionality, but it would be great for my users if I can manage it.

BTW, all my functionality for editing the user is in one EJB (it handles all 
the back-end functionality for each popup, so I don't think I can nest 
conversations as there only seems to be one per bean allowed).

Thanks,
Andrew


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

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


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to