[Nitro] Request for Transaction example

Reid Thompson Reid.Thompson at ateb.com
Tue Jun 5 15:30:08 EDT 2007


On Tue, 2007-06-05 at 21:21 +0300, Jonathan Buch wrote:
> Hi,
> 
> > explicitly setting :connection_count => doesn't yield what I expected
> > either.... had thought that setting only one connection would force all
> > transactions through that 1 and only connection...
> 
> in fact (in theory anyway) using a transaction while having :c_count on
> 1 would block the whole Thread (and so all Nitro/etc).  This is because
> the transaction gets one store from the pool, and when the User.create
> wants its pool, it will block because there's no more stores in the
> pool, waiting for stores to appear.

It does, at least I assume that's what the below error means....

rthompso at jhereg:~$ ruby tbl4.rb 
 INFO: Og uses the Postgresql store.
DEBUG: Og manageable classes: [Loadtbl]
DEBUG: CREATE TABLE tbl4test ("date" text, "ts" text, "type" text, "telno" text, "location" text, "calltype" text, "fa" text, "fn" text, "result" text, "oid" serial PRIMARY KEY) WITHOUT OIDS
 INFO: Created table 'tbl4test'.
DEBUG: SELECT * FROM tbl4test LIMIT 1
DEBUG: SELECT * FROM tbl4test LIMIT 1
/usr/lib/ruby/1.8/monitor.rb:102:in `stop': stopping only thread (ThreadError)
        note: use sleep to stop forever from /usr/lib/ruby/1.8/monitor.rb:102:in `wait'
        from /usr/lib/ruby/1.8/monitor.rb:123:in `wait_while'
        from /usr/lib/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/pool.rb:56:in `pop'
        from /usr/lib/ruby/1.8/monitor.rb:238:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/pool.rb:55:in `pop'
        from /home/rthompso/src/repo.nitroproject.org/script/../og/lib/og/manager.rb:94:in `get_store'
        from /home/rthompso/src/repo.nitroproject.org/script/../og/lib/og/manager.rb:112:in `with_store'
        from /home/rthompso/src/repo.nitroproject.org/script/../og/lib/og/model.rb:489:in `transaction'
        from tbl4.rb:36


More information about the Nitro-general mailing list