There are several options of tackeling this. Like:
* don't populate Hibernate objects directly but use value objects instead
* evict/ detach your Hibernate objects, possibly unproxying them too
(btw, one of the hibernate models has this as an option
* etc.

combine that with cloning the object before a model update (do that in
Form.beforeUpdateFormComponentModels, possibly using
wicket.lang.Objects.clone), so you can 'roll back' to that object in
onSubmit. In onSubmit you should do your checking, and set the error
manually (Component.error) if any, combined with setModelObject or
something comparable for the model you just saved.

There are alternative schemes possible if you attach a button and turn
defaultFormProcessing off.

Eelco



On 11/2/05, Phil Kulak <[EMAIL PROTECTED]> wrote:
> I know we've talked about this before, but now I need to do it and I
> have no clue. The easiest thing, of course, would be to just let the
> models get updated, do my validation, and report any errors back to
> the user. The problem is that if I let the models get changed, then
> Hibernate get's all excited and automatically updates the database at
> the end of the request. Has anyone hit this problem before?
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Wicket-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to