Ejemplo n.º 1
0
 /**
  * Returns true if this connection is still valid.
  *
  * @param timeout the number of seconds to wait for the database to respond (ignored)
  * @return true if the connection is valid.
  */
 public synchronized boolean isValid(int timeout) {
   try {
     debugCodeCall("isValid", timeout);
     if (session == null || session.isClosed()) {
       return false;
     }
     // force a network round trip (if networked)
     getInternalAutoCommit();
     return true;
   } catch (Exception e) {
     // this method doesn't throw an exception, but it logs it
     logAndConvert(e);
     return false;
   }
 }