It's fine to pick a new session whenever you please (session.Copy, for
example), and closing it when the logic is done with whatever was
being done (maybe handling a request). This will internally put the
connection used back into the pool for reuse on the next session.
If you're using only the base session rather than copying it, that's
fine as well for most applications where concurrency isn't necessary.
In those cases you can session.Refresh() at the end of the procedure
rather than session.Close(), so that the connection is put back into
the pool.
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog
-- I'm not absolutely sure of anything.
Hey there,
Hey there,