I posted something about a shadowmodel.. In the end I did this :

                                                Model<Event> eventModel = new 
Model<Event>(
                                                                (Event) 
SerializationHelper.clone((Event) model
                                                                                
.getObject()));
                                                CompoundPropertyModel<Event> e 
= new CompoundPropertyModel<Event>(
                                                                eventModel);
                                                EventWizard newWizard = new 
EventWizard(eventWizard
                                                                .getId(), e) {
                                                        @Override
                                                        public void onFinish() {
                                                                
eventRepository.update(eventModel.getObject());
                                                                
eventWizard.setVisible(false);
                                                        }
                                                };

This is the helper : import org.hibernate.util.SerializationHelper;

IT's working nicely the trick as you've discovered when the wizard are
over multiple pages..


2010/1/14 Rodolfo Cartas <rodolfocar...@gmail.com>:
> Hi! I'm currently working on a wizard to modify a pojo extracted from a
> database with Hibernate. I don't want to commit any changes to the db before
> the user finishes the wizard, but the pojo loses reference to the original
> session. Shall I eagerly fetch the object to avoid any hibernate session
> reference exceptions?
>
> Thanks,
>
> Rodolfo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to