Closed Statement [message #278246] |
Fri, 02 November 2007 09:29 |
alexleong
Messages: 2 Registered: November 2007
|
Junior Member |
|
|
Hi,
I’m experiencing the following error running a java web application on AIX version 5.3 with Oracle Database 10g Release 10.1.0.2.0? This error is only happened off and on, is there anything wrong with my java code or the database configuration?
java.sql.SQLException: Closed Statement
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java(Compiled Code))
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java(Inlined Compiled Code))
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java(Inlined Compiled Code))
at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java(Inlined Compiled Code))
at oracle.jdbc.driver.OraclePreparedStatement.sendBatch(OraclePreparedStatement.java(Compiled Code))
at oracle.jdbc.driver.OracleConnection.commit(OracleConn
ection.java(Compiled Code))
at com.evermind.sql.FilterConnection.commit(FilterConnec
tion.java(Compiled Code))
at com.evermind.sql.OrionCMTConnection.commit(OrionCMTCo
nnection.java(Compiled Code))
at com.evermind.sql.ConnectionBCELProxy.commit(Connectio
nBCELProxy.java(Compiled Code))
Below is my application configuration for JBDC.
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="xxx"
password="xxxxxx"
url="jdbc:oracle:thin:@127.0.0.1:1521:uat"
inactivity-timeout="120"
min-connections="10"
max-connections="500"
max-connect-attempts="10"
wait-timeout="60"
connection-retry-interval="10"/>
</data-sources>
|
|
|
Re: Closed Statement [message #278402 is a reply to message #278246] |
Sat, 03 November 2007 15:13 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
This exception normally is thrown when you try to reuse a callable statement that was closed already.
Check the stacktrace for the location of the offending line in your java-source.
|
|
|
Re: Closed Statement [message #278521 is a reply to message #278246] |
Sun, 04 November 2007 20:43 |
alexleong
Messages: 2 Registered: November 2007
|
Junior Member |
|
|
hi Frank,
Thanks for your reply, this exception occur at the moment my program called the commit method, but my close method is at the finally block, so the connection should not be closed. This exception is only happened occasionally, if the case like what you mentioned, this exception will occur consistently.
Regards
|
|
|
Re: Closed Statement [message #278541 is a reply to message #278521] |
Mon, 05 November 2007 00:42 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
The error does not have to occur consistently. There are more ways to close a transaction then to commit. It depends greatly on how you handle exceptions for example. Are all exceptions propagated to the java-block you are referring to, or are some handled somewhere halfway? (Either in a nice "when others" in the database-procedure, or a catch in a java method)
|
|
|