-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Martin,

On 3/6/14, 7:53 AM, Martin Gainty wrote:
> 
> 
> 
> 
>> From: neven.cvetko...@gmail.com Date: Wed, 5 Mar 2014 20:25:36
>> -0500 Subject: Re: understanding jdbc pool To:
>> users@tomcat.apache.org
>> 
>> On Wed, Mar 5, 2014 at 3:15 PM, S Ahmed <sahmed1...@gmail.com>
>> wrote:
>> 
>>> Hi,
>>> 
>>> With jdbc pool, is each socket connection in the pool handled
>>> by a separate thread?
>>> 
>>> 
>> Ahmed, thanks for asking this question - it is sometimes very
>> confusing with all different kind of pools: connection pools,
>> threadpools, etc...
>> 
>> Chris pointed out already - the connection pool does not have
>> any threads... It is not a process that runs in the background,
>> these are just connection objects that are sitting in memory.
>> 
>> Threads are created by the Tomcat container (executor) once the
>> connection is received by the Connector. The created thread is
>> then going to be handled by the container and it will go through
>> the stack call, through Valves, Filters, Servlets, your
>> middleware layer, DAOs, JDBC/JPA calls and then finally through
>> your datasource object, connection, PreparedStatement, ResultSet,
>> etc... and back all the way to the socket that browser initiated,
>> returning the thread to the threadpool (e.g. http-bio-8080).
>> 
>> Now, I am not sure about the connection pool implementation
>> details, how connection pool keeps connections open, if there are
>> any background threads that are handling connection management
>> (closing abandoned connections, opening new connections as the
>> demand rises, etc...)
>> 
>> Maybe someone can comment on that.
> MG>Not from 1.4 commons-dbcp..here is a typical reference to Thread
> in source MG>Thread.currentThread(). MG>(Although I have seen
> multiple thread calls in attached testcases) I have not seen
> Separate Thread in main body MG>I am sure  someone here would put a
> feature request in to support Thread-Aware Connections MG>If you
> put the feature request in I will second the request (and make sure
> ThreadAware gets implemented)

What in the world are you talking about? Why would any particular bit
of code need to be "aware" of the thread that is executing it? There
is no ThreadAware interface AFAIK. If there were, what would it look like?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTGfJ5AAoJEBzwKT+lPKRYNRwP/RZhZDGhrZ/tzzAifd3XFn0G
f8p3b5gx2c2+cFrdeDPAVM/l/2w4mZ5YfqCYVKqkRh7qH6+abxAC9GzVh6QqOGVG
LR1SMKBd2QtnSxZrKCJhuk/y658hMYdRyAmRuIJvqUXm4h1biYS5ivYBNnncESq4
RQNbJIi4beSXMlg05/bHSU3bS/SXANBfMGXXPR7hMoyhhkOSXbBtxHu0o/JzDxq6
9kJV/V3OG1vhLLNkHVtW4MN8WIXg0+L9b+6zsghKMollKh11yrfEvQKY92hyPy0S
f1WNgMOFUvXmHk3WcJqKBS99kijVI2Q26L26/B2mJKk4c0ETwYHmq+StjjX3AC8g
UaorwVxloGAr1BH72AqUFSHE4EOSK8lXEseyz11dI5nR2za2nSaaCZehD0BhmYhS
dTJNxYlWrBsBCbyPllhGHztTSVRPpDUAiB7P896mK1daOpkg6TIruB/vt+IUeDTb
RDKnMDCgaqJdkVOgwhbErKJrqStT0wv1Wt8Rn+6hsur02YHEf7Z0K0ITwanQvoyu
gCrnxi7zSDJDTNG3eiRMzfYus5wmaZZvk4gX+fZhSWEx/ZnTOU189UZ2WFpii7jq
oXA9AWtUN4HI7+/qCvzm6gXPn8aGqsg7ptEkxTmq2y6KgXE41alq4d+Cq+2lFIl/
SskaaMjyla9e4JdjuoQs
=PK1X
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to