the answer is simple: do not reattach objects. do not keep them across
requests unless you have a session that is open across requests. use a
detachable model that loads the objects at the beginning of the request and
discards them at the end. most times these are load-by-id operations which
are very well cached by hibernate so there is no performance hit on loading
them every request. if you use the detached object as a formbean then use
merge() to apply the changes.

-igor


On 3/23/07, Ivo van Dongen <[EMAIL PROTECTED]> wrote:


My favorite way is to use the domain objects directly, but let updates
> (to the database) always go through services/ daos and *not* have
> transactions per request. I'll still use value objects every now and
> then because sometimes it's just easier to work with a 'flat' object
> that is focussed on a particular case.



A small question in between. How do you actually control the sessions and
especially reattaching the domain objects to the session without breaking
the application layers (eg reattaching in the view layer)? I've tried using
a writable OpenSessionInViewFilter (Spring) but that ends in a lot of
LazyInitializationException stuff. I'n now using an Aspect that catches this
and reattaches the object, but this can cause a lot of nasty exception
logging :)

tnx


Eelco
>
> -------------------------------------------------------------------------
>
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>



--
Ivo van Dongen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to