Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setQuerytimeout in CallableStatement not working. Kindly please help

 
Geetha Gubendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Message broker, from Java compute node, I am calling a oracled stored procedure using callable statement. In that I am setting the timeout using setQueryTimeout() and I am setting the time as 30 secs. When I invoke the stored procedure, the stored procedure is not timing out in exactly 30 secs. For example, we tested like this.

1. we put a sleep of 3 mins with in the oracle stored procedure
Eventhough I set the timeout as 30 secs, it did not timeout soon after 30 secs but after 3 mins + (6 to 10 secs). Why is time out not happening in 30 secs?
Also in some scenerios, I am not getting SQLException at all, the stored procedure is returning the actual input xml. why is that?

Can someone help me out with this query please?
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See "Oracle® Database JDBC Developer’s Guide and Reference, 11g Release 1 (11.1)" - note on page 1-3:
JDBC Server-Side Internal Driver
The JDBC server-side internal driver supports any Java code that runs inside Oracle
Database, such as in a Java stored procedure
, and must access the same database. It
lets the Java Virtual Machine (JVM) to communicate directly with the SQL engine. This
driver supports only JDK 1.5.
The JDBC server-side internal driver, the Oracle JVM, the database, and the SQL
engine all run within the same address space, and therefore, the issue of network
round-trips is irrelevant. The programs access the SQL engine by using function calls.

Note:
The server-side internal driver does not support the cancel and setQueryTimeout methods of the Statement class.

 
Geetha Gubendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I am connecting to the database using the thin driver, jdbcracle:thin:@. Please let me know if this applies to thin server side driver as well?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic