Hi,
if you have a look to the implementation of Connection.isClosed() you will see that 
the driver always sends a "hello"-packet to the kernel if the session wasn't already 
closed by the application. Because of the reconnect feature of our JDBC driver it is 
possible that this "hello"-request will reopen
the connection. Maybe this explains your observation that the Database Manager doesn't 
show an active connection but isClosed() returns false. But after calling 
Connection.isClosed() you should see an active connection.
 
    public boolean isClosed() throws java.sql.SQLException {
        if (session == null) {
            return true;
        }
        try {
          RequestPacket requestPacket = this.getRequestPacket ();
          requestPacket.initHello ();
          this.execute (requestPacket, this, true);
        }
        catch (TimeoutException ignore){
             TimeoutException.println(this.toString()+" Inner Timeout 
"+ignore.toString());
        }
        catch (SQLException exc) {
          TimeoutException.println(this.toString()+" Inner SQLException 
"+exc.toString());
          try{
            this.session.release ();
          } catch(Exception ignore){
            TimeoutException.println(this+exc.toString());
          }
          this.session = null;
          this.DatabaseMetaData = null;
          return true;
        }
        return session == null;
    }


Regards,
Marco
----------------------------------------------
Marco PASKAMP
SAP DB, SAP Labs Berlin

> -----Original Message-----
> From: Sven K�hler [mailto:[EMAIL PROTECTED]
> Sent: Mittwoch, 4. Juni 2003 19:40
> To: Kolja Kleist
> Cc: [EMAIL PROTECTED]
> Subject: Re: AW: AW: JDBC and timeout
> 
> 
> > I'm also not happy with the "ping"-statement,
> > maybe anyone from the SAP team has a better solution?
> 
> It doesn't make sense, as long as the JDBC-Spec isn't updated or 
> extended by something like a "ping()" method.
> In fact, we wouldn't need to execute a statement, sending a packet to 
> the kernel which is answered should be enough.
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to