Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception when using setQueryTimeout() in jdbc

393 views
Skip to first unread message

Arthur James

unread,
Jan 16, 2000, 3:00:00 AM1/16/00
to
I am trying to set the query timeout value for the Statement class through
"public void setQueryTimeout(int seconds) throws SQLException" in jdbc. If I
set it to the default value 0 (which means unlimited wait), everything works
fine. If I set it to any positive value, I get the following exception, when
I try to execute a query. Does anyone what it means ?

Has anybody used setQueryTimeout() successfully ? I am wondering if this is
a problem with the oci oracle driver. Btw, I am using Oracle 8.

> java.sql.SQLException: Missing defines
> at java.lang.Throwable.<init>(Compiled Code)
> at java.lang.Exception.<init>(Compiled Code)
> at java.sql.SQLException.<init>(Compiled Code)
> at oracle.jdbc.dbaccess.DBError.check_error(Compiled Code)
> at oracle.jdbc.dbaccess.DBDataSet.createArrayFromTypes(Compiled
Code)
> at oracle.jdbc.driver.OracleStatement.doDefinesFromTypes(Compiled
Code)
> at oracle.jdbc.driver.OracleStatement.doExecuteQuery(Compiled
Code)
> at oracle.jdbc.driver.OracleStatement.doExecute(Compiled Code)
> at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled Code)
> at oracle.jdbc.driver.OracleStatement.executeQuery(Compiled Code)
> at
> com.cisco.acs.cnk.server.handler.CompanyListHelper.getCompanies(Compiled
Code)
> at
> com.cisco.acs.cnk.server.handler.InitialAuthenticationSRH.process(Compiled
Code)
> at
>
com.cisco.acs.cnk.server.request.RequestManagerImpl.executeRequest(Compiled
Code)
> at
>
com.cisco.acs.cnk.server.request.RequestManagerImpl.processRequest(Compiled
Code)
> at
> com.cisco.acs.cnk.server.request._RequestManagerImplBase._execute(Compiled
Code)
> at
> com.cisco.acs.cnk.server.request._RequestManagerImplBase._execute(Compiled
Code)
> at com.visigenic.vbroker.orb.SkeletonDelegateImpl.execute(Compiled
Code)
> at
com.visigenic.vbroker.orb.GiopProtocolAdapter.doRequest(Compiled Code)
> at
com.visigenic.vbroker.orb.GiopProtocolAdapter.dispatchMessage(Compiled
> Code)
> at com.visigenic.vbroker.orb.ThreadPoolDispatcher.run(Compiled
Code)
> at com.visigenic.vbroker.orb.WorkerThread.run(Compiled Code)

Thanks

Arthur


ykhogaly

unread,
Jan 16, 2000, 3:00:00 AM1/16/00
to
Hi,

** Calling setQueryTimeout with a non-zero value for a Statement will cause
a separate thread to be spawned (the cancel thread), which waits for the
specified number of seconds. If the query does not finish by the time it
finishes, it is canceled. However, if the query does complete before the
timeout, the spawned thread is not interrupted, and continues to wait.

** Use of the setQueryTimeOut procedure may cause memory objects to not be
reclaimed. The result is that the JDBC application will consume more
memory than is necessary.


** Complete the following information and contact Oracle Support :

1]- Version of the JDBC driver and the type of JDBC driver (Thin or OCI) you
are using.

2]- What machine is your database on and what client version are you using ?

Finally please give the timeout value in milliseconds.

E.g. if you want a query to automatically be cancelled after 4 seconds:
st.setQueryTimeout(4000);


"The Views expressed here are my own and not necessarily those of Oracle
Corporation"


"Arthur James" <aja...@cisco.com> wrote in message
news:948039025.353285@sj-nntpcache-3...

Arthur James

unread,
Jan 16, 2000, 3:00:00 AM1/16/00
to
Are you sure about this ? The documentation in java.sql.* says that the
duration should be specified in seconds.

Thanks

Arthur

0 new messages