• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in calling execute method of CallableStatement

 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application is running for a while. Usually 2 weeks once , we get the exception in JDBC call and we restart the application and it runs fine. Finally we found the source of the exception. It's from execute() method of callableStatement. The call returns exception. But there is no information in the exception object. The getMessage() function of Exception returns null and there is no stack trace.

The callableStatement execute() is being called continuously to get the record one by one. This functionality is coded in Servlet.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makesh,
I don't see the finally block where you close the resources. Maybe you have a resource leak causing the problem.
 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

I assure you that finally block is in place. I think that is not a problem. if there are more connections open, I could find out in DBA session.

Makesh
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the error is in the execute() then there is some JDBC implementation constraint that you are not property using.

From the code it looks like you are catching all possible exceptions and logging them. I am sure if you print the stack trace you will get a lot of information.

If you paste this information, then you get posts from people who have already been there and fixed the problem

Also, though not suggested, use catch (Throwable t) instead of catch(Exception e) and print the error, it is possible that the JDBC implementation is throwing an Error and not an Exception.
[ August 08, 2008: Message edited by: Raj Chila ]
 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your suggestion to use Throwable instead of Execption is a good one. I will try that one.

There is no stack trace. getMessage() of Exception returns null.

FYI, this execute method successfully ran for one month and each day it was executed more than thousand times. So I don't think I am setting some wrong properties.

Thank you for your suggestion. Your inputs are welcome.

Makesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic