• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

com.sybase.jdbc3.jdbc.SybConnectionDeadException: JZ0C0: Connection is already closed.

 
Greenhorn
Posts: 5
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Please help me on the exception which am getting while
executing stored procedure from my standalone java
application which has pool of connection objects.
Error :JZ006: Caught IOException:
com.sybase.jdbc3.jdbc.SybConnectionDeadException: JZ0C0:
Connection is already closed.
java.sql.SQLException: JZ006: Caught IOException:
com.sybase.jdbc3.jdbc.SybConnectionDeadException: JZ0C0:
Connection is already closed.
at
com.sybase.jdbc3.jdbc.ErrorMessage.createIOEKilledConnEx(Unknown
Source)
at
com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(Unknown
Source)


Am using sybase db version ASE 15.0.3/EBF17775
and using driver jar jconn3.jar 6.05/EBF16676(Recently
upgraded)
Since upgrade facing the above exception now and then.

Thanks in advance for your help.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Isn't it possible that this is connected to the other exception you're encountering? If the Connection already closed is always preceded by the Read timed out exception, then perhaps the connection gets closed after that timeout and your exception handling code (perhaps a finally block) closes it again? And perhaps the upgrade caused some change to the timeout interval?

(I personally find it amusing that a call on Connection.close() may fail. I just catch and log any exceptions raised by this call and that's it, I wouldn't know what to do with these exceptions annyway.)
 
bhas nik
Greenhorn
Posts: 5
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Martin,

Thank you for your response and for your valuable time.
Into the issue ---it is not related to the other exception which i have encountered and posted.This is completely different exception which i encountered on one day and other on other day.This SybConnectionDeadException am getting it now and then ..... i suspect this could be because of the version upgrades of jconn3.jar , commons-pool-1.5.5.jar and commons-dbcp.jar.Please help.Thanks in advance.
 
Martin Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where in your code does the exception occur? Ie. what DB operation is your code doing at that time?
 
bhas nik
Greenhorn
Posts: 5
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At the below said place am getting the exception.

CallableStatement cls = connection.prepareCall("SOME STOREDPROCEDURE");
cls.setString(1,"SOME STRING");
cls.setString(2, "SOME STRING");
cls.setString(3, "SOME STRING");
cls.setString(4, "SOME STRING");
cls.setString(5,"SOME STRING");
cls.setString(6,"SOME STRING");
cls.setString(7,"SOME STRING");

rs = cls.executeQuery();(AT THIS POINT AM GETTING THE EXCEPTION)
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your exception indicates that "Connection is already closed.". In that case you should be getting an exception at line:
CallableStatement cls = connection.prepareCall("SOME STOREDPROCEDURE");
Because at this line you are trying to creates a CallableStatement on a closed connection. As per Connection.prepareCall() api,
Throws:
SQLException - if a database access error occurs or this method is called on a closed connection

Sometimes it does happen that you unintentionally close your connection at some point in your code. I would suggest for test purposes to check the status of your connection using isClosed() before you start doing stuff with it. Also check how your connection is handled, particularly at what points you close it. Use search in Eclipse or RAD for this purpose.
 
bhas nik
Greenhorn
Posts: 5
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Abdulla,

Thanks for your response.
Into the issue exception is not getting thrown at preparecall ....exception is coming at line executequery().One more thing need to say is connection is no where it is closed once it is created untill it finishes the retrieval from resultset and in finally am closing the connection.If connection is closed in the code before calling executequery() then it will happen everytime i do call this block of code , so it is not happening everytime i do call and this code is running since ages.But here i want mention clearly is after updating the jars (2 to 3 months back updated) which mentioned earlier am facing this type of issue once in month or two.This block of code runs roughly for thousands to lacks of times in a month and almost all the times it is executing perfectly.Here again i can say i do suspect on updated jars versions conflicts.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, bhas nik!

I´m facing exactly the same problem. I have the same situation:
- migration: jconn2 to jconn3
- This exception (same com.sybase.jdbc3.jdbc.ErrorMessage.createIOEKilledConnEx) on CallableStatement.executeQuery for a procedure call

Did you find some work-around solution for this ?

Database: Sybase ASE 15.2

Thanks in advance.
Kind regards
Alex
 
reply
    Bookmark Topic Watch Topic
  • New Topic