commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raihan Kibria (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DBCP-438) Nested connections in a transaction (local) throws null pointer
Date Thu, 30 Apr 2015 10:24:06 GMT
Raihan Kibria created DBCP-438:
----------------------------------

             Summary: Nested connections in a transaction (local) throws null pointer
                 Key: DBCP-438
                 URL: https://issues.apache.org/jira/browse/DBCP-438
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 2.1
         Environment: All (linux, aix, windows)
            Reporter: Raihan Kibria


In a transaction context, if we open multiple connections and close each of them after commit,
we get a null pointer exception. Sample code:
		transactionManager.begin();
		
		Connection c1 = null;
		Connection c2 = null;
		
		c1 = newConnection();
		c2 = newConnection();
		
		transactionManager.commit();
		
		try{
			c1.close();
		}catch(Exception e){
			e.printStackTrace();
		}
		
		try{
			c2.close();
		}catch(Exception e){
			//throws execption
			e.printStackTrace();
		}

Null pointer is thrown at:
org.apache.commons.dbcp2.DelegatingConnection.closeInternal




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message