Title: FW: Connection Pooling bug in Minerva, SQLException "Statement closed"


 -----Original Message-----
From:   Gustav Bostrom 
Sent:   den 8 januari 2001 11:43
To:     '[EMAIL PROTECTED]'
Subject:        Connection Pooling bug in Minerva, SQLException "Statement closed"

Hi!

I hav after some hours debugging found a bug in the Minerva Connection Pool.
I get a "Statement Closed" ("Suljettu Lause" in Finnish, a colleague translated it for me. I get my Oracle error messages in Finnish, Swedish or English for some reason.)

The configuration I am running is as follows:
* jBoss 2.0 final
* Oracle 8.1.6i using the OCI driver
* Minerva configured to use the XA Wrapper ( I never got Oracles XA DataSource to work).
<!-- Add a Connection pool for Oracle -->
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar,classes12.jar" CODEBASE="../../../lib/">
    <ARG TYPE="java.lang.String" VALUE="Oracle">
    <ARG TYPE="java.lang.String" VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>

What happens is that every other time I get a SQLException "Statement Closed" when I close my pooled Connection.
Looking into the code my guess is that the problem is situated in the class org.jboss.minerva.jdbc.ResultSetInPool, in the method getStatement()

The original code says:

public Statement getStatement() throws SQLException {
                if(impl == null) throw new SQLException(CLOSED);
                try {
                        return impl.getStatement();
                } catch(SQLException e) {
                        setError(e);
                        throw e;
                }
        }
I think this is wrong since it returns the implementations statement instead of the wrapped statement.
When we change the code to:

public Statement getStatement() throws SQLException {
                if(impl == null) throw new SQLException(CLOSED);
                return st;
        }

,everything works beautifully.

Best regards,

gustav bostr�m
framework architect
the eon company
www.eoncompany.com

o +46-8-54528800
m +46-70-9575154
e gustav.bostr�[EMAIL PROTECTED]


Reply via email to