Bugs item #816243, was opened at 2003-10-02 00:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=816243&group_id=22866

Category: None
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Fesler (cfesler)
Assigned to: Nobody/Anonymous (nobody)
Summary: NullPointerException in WrappedConnection.unregisterStmt()

Initial Comment:
JBoss 3.2.2RC4

IBM JDK 1.4

Linux (SuSE 8.2)



java.lang.NullPointerException

        at

org.jboss.resource.adapter.jdbc.WrappedConnection.unregisterStatement(WrappedConnection.java:809)

        at

org.jboss.resource.adapter.jdbc.WrappedStatement.close(WrappedStatement.java:49)



Inspection of WrappedConnection.jpp suggesed that this

may be related to the fact that the connection.close()

is being called (in our application code, not in jboss)

before statement.close():



WrappedConnection.jpp 



public void close() throws SQLException

   {

      closed = true;

    ...

      mc = null;

   }



    ...



   void unregisterStatement(WrappedStatement ws)

   {

      if (mc.getTrackStatements() == false) 

    ...



The NullPointerException occurs on the last quoted line

(i.e., "if (mc.getTrackStatements() ..."), which is

what leads me to the suspicion that I stated above,

regarding the order in which close() is called in our

application. For reference, here's the relevant snippet

of our code (pseudocode, with null checks, etc. removed):



    connection.close()

    resultSet.close()

    preparedStatement.close()



I switched the order of the statements in our

application to:

    

    resultSet.close()

    preparedStatement.close()

    connection.close()



And the problem went away. Nevertheless, this is a bug

in jboss that ought to be fixed (the jdbc spec

specifically permits calling close() on closed

statements--and even if it didn't, a

NullPointerException would be the wrong result).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=816243&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to