createStatement with parameter is causing problem  
guest Mon Feb 11 15:09:38 GMT 2008
 
Hi,

Dude in Connection Interface, there are three types of createStatement() methods.
The signature of those methods are as:

1. Statement createStatement() throws SQLException;
2. Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException;
3. Statement createStatement(int resultSetType, int resultSetConcurrency,int resultSetHoldability) throws SQLException;


When we calls the createStatement() without parameter (refer above 1.) on PooledConnection (returned by primrose) everything works fine, it returns a statement of type PoolStatement which internally maintains the history of ResultSet and does much more. Till now everything is fine.

But when we calls the createStatement with parameter it returns the actual Statement returned by the driver rather than the type of PoolStatement reason of this is as the PoolConnection just deletgates the call to the actual connection object.


Here is the implementaion from PoolConnection :

public Statement createStatement() throws SQLException {
connHolder.numberOfJDBCStatementsRun++;
PoolStatement ps = new PoolStatement(conn.createStatement(), connHolder); //Returning PoolStatement.
return ps;
}

public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException{
return conn.createStatement(resultSetType, resultSetConcurrency); //Returning Actual Statement
}

public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException{
return conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); //Returning Actual Statement
}


The above two method seems to problamtic as,
* As primrose maintains the history of ResultSet, so even the ResultSet is closed primrose flags that you have open connections.


Can you put some light on it ? And please suggest us the alternative.


 
sedj Mon Feb 11 19:59:52 GMT 2008
 
Hi,

I'm afraid you've found a bug :(
We'll fix it and put a release out asap (hopefully by the weekend) ... if you use the "contact us" form to mail us, we'll let you know when the fix is released.

Thanks for letting us know.

Ben
Amit Goyal Tue Feb 12 16:07:19 GMT 2008
 
Thanks for your quick reply.

Regards,

Amit Goyal
sedj Sun Feb 24 20:01:23 GMT 2008
 
Version 3.0.11 has been released.