Em 08-01-2013 17:11, Jeremy Evans escreveu:
On Tuesday, January 8, 2013 9:58:22 AM UTC-8, Rodrigo Rosenfeld Rosas
wrote:
I was also thinking about another approach. Using an
"after_connect" proc to set the search_path to the one set by a
thread local variable if one is set. That way I don't need to
always use the same connection. It would also be much simpler to
implement and wouldn't have much drawbacks, right?
after_connect is only called when the connection is originally
created, not every time the connection is checked out. So I don't
think that would work.
You don't want to run a query every time the connection is checked out
if you can avoid it, unless you are manually controlling the
connection checkouts, as otherwise it can hurt performance.
Yes, I understand, but maybe the performance hit would be smaller than
the other simple alternative (limiting concurrent requests to available
db connections through Database.synchronize Rack middleware).
But I guess there isn't any after_checkout hook, right?
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.