Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify IBatis query timeout

There is a way to specify IBatis query timeout using oracle jdbc and Java?

Thanks

like image 443
Victor Avatar asked Oct 05 '10 17:10

Victor


1 Answers

From the iBatis manual :

in the <settings> element :

defaultStatementTimeout

(iBATIS versions 2.2.0 and later) This setting is an integer value that will be applied as the JDBC query timeout for all statements. This value can be overridden with the “statement” attribute of any mapped statement. If not specified, no query timeout will be set unless specified on the “statement” attribute of a mapped statement. The specified value is the number of seconds the driver will wait for a statement to finish. Note that not all drivers support this setting.

on the statement paremeters :

timeout

(iBATIS versions 2.2.0 and later only)

Sets the JDBC query timeout for this statement. Any value specified here will override the value specified in the “defaultStatementTimeout” setting in the SQLMapConfig.xml file. If you specify a default timeout and decide that you don't want a timeout for a particular statement, set the timeout value to 0. The specified value is the number of seconds the driver will wait for a statement to finish. Note that not all drivers support this setting.

The oracle drivers support this functionality, so this should work.

like image 56
Peter Tillemans Avatar answered Oct 15 '22 08:10

Peter Tillemans