commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: DBCP woes (running out of cursors).
Date Thu, 15 Oct 2009 20:49:42 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bill,

On 10/15/2009 2:24 PM, Bill Davidson wrote:
> That does make me wonder though if there are Connection's getting sent
> back to the pool that had a pending transaction without a commit/rollback
> and if that could be making any cursors on that connection after that
> linger?

Probably not. DBCP calls setAutoCommit(true) by default in order to
reset the connection as it goes back into the pool. Any pending
transaction is committed (!) when that happens, so there shouldn't be
any in-progress transactions lingering around.

If you set autoCommit="false" in your DBCP configuration, that might
change things. Are your transaction finally blocks and commit/rollback
logic blocks sane? You can refer to my previously-mentioned blog post
for my thoughts on how to do it properly.

> It might explain the randomness of the queries showing up in
> the list.

But what is the likelihood of "SELECT * FROM foo WHERE foo.id=?"
appearing in a transaction?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrXiuYACgkQ9CaO5/Lv0PDX1QCfUhGfjpNnU6mnff8g6WqRb7MN
vxMAoK3xes9KEfE5V8J/ZSGKCY2SqMRp
=6lz1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message