1

I am getting the Error in Production as per below. Can any one give some input to eliminate this error.

java.sql.SQLException: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
    at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3550)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3396)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3460)
    at com.IBS.trade.order.netPortfolio.getClientPortfolioDetails(netPortfolio.java:556)
    at core.ClientThreadInteractive.getNetPortFolioData(ClientThreadInteractive.java:14403)
    at core.ClientThreadInteractive.netPortfolioSingle(ClientThreadInteractive.java:14370)
    at core.ClientThreadInteractive.run(ClientThreadInteractive.java:1895)
3
  • 3
    The JDBCConnection is closed when you try to execute an SQL statement. Can you show the code? Commented Jun 30, 2014 at 9:18
  • give the connectivity code Commented Jun 30, 2014 at 9:19
  • 1
    Provide your way of using connection, some code then I can provide better solution Commented Jun 30, 2014 at 10:48

3 Answers 3

3

Track shows that your connection has been closed when you are trying to use. There are few possibilities depending on your connection management.

1- Your invoked close().

2- You exceed the maximum idle timeout so database has closed your connection.

Basically it depends how you manage your connections if using per thread then may be possible that somewhere it closed during your thread that wasn't working.

-- Some details about your connection management can explain it better

Sign up to request clarification or add additional context in comments.

Comments

2

Somewhere you are closing connection.

con.close();

And after that trying to access the database.

7 Comments

Then it seem it is a connection timeout issue..Are you using any connection pooling ?
For real time system Response of Any query need to be fast. If taking high time for connection Timeout can paralyzed the system. It can have cascade effect.
By connection Timeout,I mean if the connection remains idle for more than specified timeout time, connection gets closed. It is handled by connection pulling mechanism.So if you are already using pooling problem can be something different.
Can it raised due to database side Connection Restriction!! Oracle Database level there is parameter which define the no of connection can be opened at database. But at database alert log there is nothing found for the said error.
Is it possible to you to restart the Oracle database..If after restart problems goes away..It is related to connection pooling..
|
0

Simply restarting the Application worked for me. This error is due to unavailability of resources or unable to connect to DB for some reason in JDBC.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.