On Wed, July 18, 2007 05:16, Fei Liu wrote:

> After I cleared the transactor code, I no longer get any resource pool
> issue. My transactor is simple a T.exec(statement)...nothing to be
> further added/removed there. I'd like to request the next libpqxx
> release to include a multi-thread example...

So you get the lockup when your transactor just executes a simple query? 
Then presumably that is also _where_ the lockup happens.  I can think of a
few cases where the query could possibly lock up:

Network timeouts.  You can't be getting network timeouts, since you're on
a local socket.

Database lockups.  Those happen when you manually lock a table in SQL, and
don't release it.  Or sometimes you can get very long delays if you vacuum
or analyze large tables while somebody else is also doing that.  Finally,
long waits can happen if you try to access tables from a serializable
transaction that someone else is modifying in a long-running transaction. 
Is anything modifying the tables you're working with, whether in your
program or something else using the same database at the same time?  Or is
anyone explicitly locking database tables?

Broken select() code.  The code that waits on the client socket would be a
good suspect, except that libpqxx doesn't use any such code of its own
during normal usage.

If it's none of that, then I can only think of a threading problem in
libpq.  And I know very little about that.  The default build of libpq is
threadsafe nowadays.  I don't know how to tell whether a particular build
is, though.  With multithreading it's possible that a signal gets
delivered to a different thread than you expect, and that might perhaps
still affect libpq in some cases, but for that to break anything you'd
probably have to be on a pretty unusual platform.

One way of figuring out what's happening would be to attach a debugger to
a stuck thread in the simplified program, and seeing what it's trying to
do when it gets stuck.


Jeroen


_______________________________________________
Libpqxx-general mailing list
Libpqxx-general@gborg.postgresql.org
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to