You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by J <we...@fluidic.com> on 2003/06/24 23:02:12 UTC
AbstractEngine.cleanupAfterRequest() question
I'm using Hibernate as my database layer, and I have a quick questions
about AbstractEngine.cleanupAfterRequest() method.
Does this method always run when the request is completed its round trip?
Would this be a good place to close connections that would be stored in a
ThreadLocal variable?
I'm trying to make some of the object/relational mappings faster by using
lazy initializations for related objects. Right now, if I load a single
object that 300 relationship, all 300 related objects are
loaded. Sometimes I just don't need that. So I was going to place a
session in a ThreadLocal variable so each thread would have its own "object
connection" (called a session in Hibernate) . During that request, a
single session would be available to the request until it was
finished. Then in the extend class of BaseEngine, I would have code that
could close this object connection. Good idea or bad idea? Anyone else
have any patterns that work well with Tapestry?
J