[Nitro] Request for Transaction example

Jonathan Buch john at oxyliquit.de
Wed Jun 6 02:05:16 EDT 2007


Hi,

> 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).
>
> 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.

this is exactly the idea which I had and already posted, good, that means
we're on the right track if others are doing that successfully already!

> But then I'm coming in halfway through this, so I might be way off :)

Nope, you're helping, really good to see that this approach works. :P
Would be good to know if there are any race conditions though and if
my Thread.critical was necessary there...

Anyway, thank you very much,

Jo

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Nitro-general mailing list