<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You could steal a Java trick and associate a connection with the
current thread when you begin a transaction. Then each call to
$og.store.conn checks to see whether the current thread is in a
transaction, and if so which connection is servicing it (basically a
hash lookup of thread.__id__ to connection, defaulting to
anything-from-the-pool).<br>
<br>
When the connection is committed or rolled back, the association is
broken so any further calls to $og.store.conn go back to the pool again.<br>
<br>
But then I'm coming in halfway through this, so I might be way off :)<br>
<br>
Cheers,<br>
Dan<br>
<br>
<br>
George Moschovitis wrote:
<blockquote
cite="mid:afd80b540706051100n72033d9cn67da91915e3da6ed@mail.gmail.com"
type="cite">Argh... this is very annoying indeed... <br>
<br>
unless anyone beats me and provides a patch (hint, hint) I will resolve
this tomorrow.<br>
<br>
-g.<br>
<br>
<div><span class="gmail_quote">On 6/5/07, <b class="gmail_sendername">
Reid Thompson</b> <<a moz-do-not-send="true"
href="mailto:Reid.Thompson@ateb.com">Reid.Thompson@ateb.com</a>>
wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On
Tue, 2007-06-05 at 12:53 -0400, Reid Thompson wrote:<br>
<br>
> > ><br>
> ><br>
> > so the default initialization starts 5 connections to the
database?<br>
> > and we're utilizing 'more than one' in our scenario?
<br>
><br>
> OK -- I think I see...<br>
> ./lib/og/manager.rb<br>
> 66: (options[:connection_count] || 5).times do<br>
<br>
explicitly setting :connection_count => doesn't yield what I expected<br>
either.... had thought that setting only one connection would force all
<br>
transactions through that 1 and only connection...<br>
_______________________________________________<br>
Nitro-general mailing list<br>
<a moz-do-not-send="true" href="mailto:Nitro-general@rubyforge.org">Nitro-general@rubyforge.org</a><br>
<a moz-do-not-send="true"
href="http://rubyforge.org/mailman/listinfo/nitro-general">http://rubyforge.org/mailman/listinfo/nitro-general</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<a moz-do-not-send="true" href="http://georgeandstella.com">http://georgeandstella.com</a><br>
<a moz-do-not-send="true" href="http://blog.gmosx.com">http://blog.gmosx.com
</a><br>
<a moz-do-not-send="true" href="http://cull.gr">http://cull.gr</a><br>
<a moz-do-not-send="true" href="http://www.joy.gr">http://www.joy.gr</a><br>
<a moz-do-not-send="true" href="http://nitroproject.org">http://nitroproject.org</a>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Nitro-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nitro-general@rubyforge.org">Nitro-general@rubyforge.org</a>
<a class="moz-txt-link-freetext" href="http://rubyforge.org/mailman/listinfo/nitro-general">http://rubyforge.org/mailman/listinfo/nitro-general</a></pre>
</blockquote>
<br>
</body>
</html>