Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3258

JDBC artificats should throw SQLException when already closed

XMLWordPrintable

      In the change to fix JBAS-2741 I mistakenly made the JDBC wrappers throw an SQL
      exception if the artifact is already closed. They should just return with an exception.

      From the Javadoc:
      "Calling the method close on a Statement object that is already closed has no effect."

      e.g. In WrappedStatement

      public void close() throws SQLException
      {
      synchronized (lock)

      { if (closed) throw new SQLException("Already closed"); closed = true; }

      lc.unregisterStatement(this);
      internalClose();
      }

      this should be:

      public void close() throws SQLException
      {
      synchronized (lock)

      { if (closed) return; closed = true; }

      lc.unregisterStatement(this);
      internalClose();
      }

              weston.price Weston M. Price (Inactive)
              adrian.brock Adrian Brock (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: