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

    Details

      Description

      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();
      }

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  weston.price Weston M. Price
                  Reporter:
                  adrian.brock Adrian Brock
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: