You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Drew McAuliffe <dr...@lowerunit.com> on 2004/04/17 06:25:38 UTC

Session in View pattern

Is there a recommended way to perform Hibernate's "get Session in View"
pattern using HiveMind? I'm imagining that if there is, it's come out of the
Tapestry integration. For example, I've been using webwork2 for a while now.
I set up a request-scoped component that provides a session to any
session-aware actions. The action uses that session for any db work, and
exposes it for any corrollary web helpers. There's a servlet filter that
creates a ThreadLocal session, and that's the session that's exposed to the
action.
 
I'm imagining, from what I've read of the threading features in HiveMind,
that this same thing would be relatively easy without having to explicitly
set up a custom ThreadLocal session provider. You would potentially just set
up a session service and have it scoped on a per-thread basis (as opposed to
singleton, simple, pooled, etc.). Does that sound right? Or is there a
better way? Are there any examples of this from the Tapestry world that use
(or will use) HiveMind for a similar pattern?
 
Thanks,
 
Drew