db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: How can I look the connection count of a derby database
Date Wed, 07 Mar 2007 15:33:13 GMT
Dag.Wanvik@Sun.COM (Dag H. Wanvik) writes:

> I played with this a bit after starting a server on trunk and am
> wondering about one 'feature' or bug, not sure which; I connected from
> ij cia the client driver, made a few connections, and the above
> command showed me the connections and prepared statement of
> each. Howeverm when I shut the database, the tool still showed the
> connections, in fact, even when I shut down the system, the same info
> came out.. Is there some cache which is not being invalidated here, or
> is there something else going on? Dangling session objects?

Sorry for the confusion, the information printed for sessions ("#
Active Sessions") is the connection as seen by the network server: so
even when database and system is shut down, the server may still have
"active" session objects, if they are not closed from the clients
(they will not be usable any more). That is, the session may be dead
in database, but it will be "active" in the server (they are read
blocked, waiting to hear from the client). They will not be
interrupted (unless derby.drda.timeSlice is used), so it is important
to close them to avoid leakage in the server.

Discussing this with Bernt, he noted that some sessions sharing
threads (if we hit max (more seesions than available threads), and
timeslicing is used) will not get printed, since "runtimeinfo" just
traverses the threadList. The number of such threads currently not
being serviced is printed as "# Waiting Sessions". It would have been
useful to print these sessions as well, perhaps.

"# Connection Threads" is the total number of session threads yet
allocated in the server (threadList). This can be limited by setting
the network server property derby.drda.maxThreads.

View raw message