On Jan 31, 4:59 am, ap...@[EMAIL PROTECTED]
wrote:
> On 31 Jan, 12:46, ap...@[EMAIL PROTECTED]
wrote:
>
> > Our java program hang in the sybase JDBC driver when it calls
> > isClosed.
>
> I have just found out something that might be relevant. isClosed is
> called from our connection pool mgr. I just saw this note (below) on
> the web sitehttp://java.sys-con.com/read/111252_2.htm:-
>
> Large-scale deployments often face another problem when a pool is
> populated with a large number of connections. How does the pool
> manager detect when a connection has become invalid? Today, there's no
> facility inside a JDBC driver to check and see if a connection is
> still valid. The Connection.isClosed() method is sometimes mistakenly
> thought to do this, but the intent of isClosed() is to check and see
> if a connection is open or closed, not whether the connection is still
> usable.
>
> Looks like our connection mgr has fallen into this pit. It is using
> jconn3 which I suppose will be too old to use the new isValid method
> that the web page talks about. I wonder if this is related to the
> problems we are seeing. The env is very unstable and sybase
> connections are being lost frequently.
>
> Regards,
>
> Andrew Marlow
I think there's a connection option to change the functionality
of the isClosed() call. The Sybase driver is too ambitious by half
in this call. By spec, the call is supposed to be almost useless.
The space says that all it's supposed to do is to tell you whether
you have already called Connection.close() yet or not. It is *not*
supposed to do anything or check anything at the DBMS, but
that's what Sybase's driver is doing.
IsValid() would be doing the same thing, and there is no way to
really verify whether a connection is still good, except to run a
short query like "select 1" which is likely what the sybase driver is
doing under the covers anyway. And whatever has gone wrong,
anything the driver is sending to the DBMS is being ignored.
Do you have a firewall between you and the DBMS? It looks
like the connection had been left idle long enough to be
cut off.
Joe Weinstein at BEA Systems


|