db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: [jira] Commented: (DERBY-938) ContextManager needs to be optimized
Date Fri, 10 Feb 2006 01:06:21 GMT
Mike Matrigali wrote:

> Is it true that each context manager is a thread local variable?  With
> connection pooling I know that a connection and it's associated context
> manager can be executed on a different thread each time it enters
> the jdbc stack.

No the context manager is not a thread local variable. A thread local
variable is used to provide linkage from the current thread to the
correct context manager. This linkage only exists while the thread is
executing code using that context manager's connection in the derby
engine. It is set up upon entry into the JDBC driver and cleared upon
leaving the JDBC driver, for each significant method, e.g. rs.next(),
ps.executeQuery. There are performance gains to be had here as well, by
avoiding this context pushing/setup. Need more time for a full explaination.

And yes the asusmption/requirement is the context manager is single
threaded though not owned by a single thread.


View raw message