Query timeout on 10g thin driver

I'm using the Statement.setQueryTimeout(...) method, but it doesn't seem to work when the server is shutdown.
I do the following:
1) create the statement and set the query timeout to 30 seconds
2) run a query that gets stuck waiting for a lock (ie select for update...)
Now, if I let it run normally I do see the following exception:
ORA-01013: user requested cancel of current operation
However, if I run the same query, but shutdown the database server before releasing the lock I see the client application hang indefinitely. The 30 second timeout never occurs.
If I take a thread dump I see my client is stuck on a socket read, which will never come because the db server was shutdown.
Why isn't the jdbc driver honoring the 30 second timeout if it can't communicate with the server? Does this mean that the timeout is actually controlled on the server-side?
any info is appreciated,
Brett

You didn't say how you were setting the client timeout, but this has worked for me in an adp.
'Temporarily increase query timeout, which is an application-wide setting
'CurrentProject.Connection.CommandTimeout = 60 'Too late to change this setting- no effect
Const cstrTimeoutOptionName As String = "OLE/DDE Timeout (Sec)"
Const clngTimeoutSecondsForQuery As Long = 300
strQueryTimeOutOriginal = Application.GetOption(OptionName:=cstrTimeoutOptionName)
Application.SetOption cstrTimeoutOptionName, CStr(clngTimeoutSecondsForQuery)
Paul

Similar Messages

  • Proxy authetication using 10g thin driver

    Hello,
    I am using 10g, and bea 81 sp3, I am trying to setup proxy authetication. All the references I find for proxy authetication are using OCI driver. Is proxy authetication supported using oracle 10g thin driver (ojdbc14.jar)? Can anyone provide me an example using thin driver?
    appreciate any help,
    Shailesh

    Thanks annie..I googled it but didn't find this one..:-(
    I actaully wanted to implement proxy authetication using thin driver (no oci) but i can't figure out ...and all examples i saw were using thin driver..I found many articles which says that thin driver does support proxy authetication and I am using all latest (10g)..so..:-(
    appreciate any help
    Shailesh

  • Query TImeout with ORACLE JDBC driver

    I want to halt an execution of query if an query takes more than specified time. Not only the query should be cancelled but the error should be thrown at client. I am using ORACLE 11g JDBC driver.
    I have used statement.setQueryTimeout() for the same. Moreover, my application is an OLTP system handling thousands of calls per second and one call is of 4 to 5 queries. Can anyone explain whether querytimeout will work in this case and its drawbacks if any.

    Dear user10366531,
    Your question about setQueryTimeout() has been already disscussed in this topic (Setup "QueryThreshold" parameter
    (Chris Jenkins aswered).
    Best regards,
    Gennady

  • Proxy Authetication adn thin driver

    Hello,
    Can any one provide sample for proxy authetication using oracle 10g thin driver?
    All I saw oci samples, and documentation says, thin can also perform proxy authetication...
    Thanks in advance,
    Shailesh

    Hi,
    yes you can use thin friver as well. I am using the 10.1.3 product stack and this works for me.
    Frank

  • Oracle proxy authetication and thin driver

    Hello,
    I am using 10g, and bea 81 sp3, I am trying to setup proxy authetication. All the references I find for proxy authetication are using OCI driver. Is proxy authetication supported using oracle 10g thin driver (ojdbc14.jar)? Can anyone tell me, what drivers are support proxy authetication under oracle 10g?
    Also application servers like bea will not give you oracledata source if you use bea to setup oracle connection pool, is there a easy work around that?
    appreciate,
    Shailesh

    Replace this line:
    DriverManager.registerDriver(new racle.jdbc.OracleDriver());with this one:
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

  • Oracle/thin driver slow

    I am running a query on oracle 8.1.7.3 database. when I run it from the command line sqlplus it returns with the result in .5 seconds. when I try the same query from the jdbc thin driver ( 9.0.1 ), it just keeps waiting for 30 seconds.
    Is there a known problem with the oracle thin driver ? if so is there a way out of this ?
    Thanks,
    Dash.

    There's no reason why a driver would simply get slower from one version to another. The only explanation I see for this is that you are using scrollable or updatable result sets which is not quite the same as running the query. A scrollable/updatable result set creates a cursor with your query so it's way slower than a forward-only, read-only result set.
    As a result, the reason why an older version of a driver might be faster would be that it either did not implement scrollable result sets or it has introduced an option (in the URL or connection properties) to use regular or cursor result sets (e.g. the Microsoft and Data Direct drivers have an option for the type of result sets to be used; if this option is set to cursor, you can use any number of Statements per Connection at the cost of performance).
    Alin.

  • Proxy Connection with thin driver

    Hello,
    I am using 10g, and bea 81 sp3, I am trying to setup proxy authetication. All the references I find for proxy authetication are using OCI driver. Is proxy authetication supported using oracle 10g thin driver (ojdbc14.jar)? Can anyone provide me an example using thin driver?
    appreciate any help,
    Shailesh

    See the following link for documentation on proxy authentication. http://download-uk.oracle.com/docs/cd/B19306_01/java.102/b14355/proxya.htm
    Also, the release note for 10gR2 JDBC driver installation includes the following text:
    Proxy Authentication
    In Oracle 10g R1 we introduced proxy authentication for the
    OCI driver. In this release we introduce a common proxy
    authentication api that is supported by both the Thin and
    OCI drivers. We strongly recommend that you use the common
    api instead of the OCI specific api.

  • Hung queries, and Oracle thin driver query timeout implementation

    We are seeing occasional instances of stuck threads, where the code is in Oracle thin XA driver code waiting for a socket read for a response from the database. Usually only one thread at a time. The connection never terminates and we have to shut down WebLogic to clear it. The DBAs tell us that all connections to the 11g RAC cluster members from our hosts are idle, with no hung or long-running transactions.
    This happens every few days across two WebLogic 10.3.5 clustered instances in our QA environment, usually not the same time on two servers (one had four incidents, the other had only one, in the last 15 or so days). Sometimes it has resulted in a hung server, as the driver is holding a lock that blocks other threads (today we had numerous threads block in a TX rollback).
    I'm guessing our WebLogic instance somehow is not getting the connection close from the remote host. BTW, there is no firewall between us and the DB. I have not got any strong suspect for the cause (although we are running Linux on a VMWare 4.0 VM, which always worries me).
    Ordinarily I'd either ask the application to set a query timeout, or set the query timeout parameter for the connection pools as a workaround (we are using a MultiDatasource), so the transaction would at least abort and the application can handle it. However, while the Oracle driver does support java.sql.Statement.setQueryTimeout(), some brief investigation on my part leads me to believe the timeout is implemented on the server side and not the client side - so that if it is indeed the case that WebLogic does not see the close on the connection, it also would never see the timeout.
    Two questions:
    1. Is my suspicion about server-side implementation of timeout for Oracle 11g correct?
    2. If so, is there some property I can set for the driver that will implement a socket timeout? Is this "safe"?
    Thanks for any help!
    [ Oracle WebLogic 10.3.5, HotSpot 64 bit JVM 1.6.0_29 on RHEL 5.6 on VMWare; Oracle Thin XA driver bundled with WebLogic; Oracle RAC 11g (three-node cluster)]
    Edited by: SteveElkind on Dec 3, 2012 5:25 AM

    Thanks, Joe.
    My investigations were heading in this direction (e.g., http://docs.oracle.com/cd/B28359_01/java.111/b31224/apxtblsh.htm#CHDBBDDA). However, for WebLogic, is it as simple as adding the following property in the Datasource Connection properties edit box in the WebLogic console?
    oracle.net.READ_TIMEOUT=300000
    or do I have to edit the connection URL?
    I've tried this, and the Datasource restarts OK after the change, but I have no way right now to check whether it actually "works".
    (we have some long-running queries; five minutes seems to be a "safe" limita for now)

  • Setting query timeout in TopLink 10g

    The 10g version of OAAM uses TopLink 10g Release 3 (10.1.3.1.0) (Build 061004) and Oracle JDBC Driver 10.2.0.2.0. We are not using TopLink Essentials. I'm trying to make it so that our queries will timeout and throw an exception if they take too long. I have tried several things, but haven't had any luck so far. I have tried each of the following:
    * Adding <property name="javax.persistence.query.timeout" value="1"/> to the <login> element in sessions.xml.
    * Setting the query policy in my descriptors like this:
    <opm:querying xsi:type="toplink:query-policy">
    <opm:timeout>1</opm:timeout>
    </opm:querying>
    * Calling DatabaseQuery.setQueryTimeout(1).
    * Calling setProperty("javax.persistence.query.timeout") on the database login, server session, client session, and unit of work.
    In each case, I tried to update a locked table, and the application simply hung until I unlocked the table. I also tried executing select queries that take around 15 seconds to run, and those completed normally. I want to make the application throw a database exception instead. How can I make this work?
    I ran this test to eliminate the JDBC driver as a suspect:
    java.util.Properties props = new java.util.Properties();
    Class.forName("oracle.jdbc.driver.OracleDriver");
    props.setProperty("user", "teng_oaam");
    props.setProperty("password", "******");
    java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@******:1521:brsadb", props);
    System.out.println(conn.getMetaData().getDriverName() + " " +conn.getMetaData().getDriverVersion());
    java.sql.Statement stmt = conn.createStatement();
    stmt.setQueryTimeout(1);
    System.out.println(stmt.getClass());
    System.out.println(new java.util.Date());
    try {
    // this query takes about 20 seconds to execute
    java.sql.ResultSet rs = stmt.executeQuery("select * from vcrypt_ip_location_map where from_ip_addr<=1160157297 and to_ip_addr>=1160157297");
    } catch (Exception ex) {
    ex.printStackTrace();
    System.out.println(new
    java.util.Date());
    The query fails with ORA-01013, which is what I expect to happen, so the problem is not in my JDBC driver.
    Thanks,
    Josh Davis

    public static Integer executeUpdate(TopLinkDBMgr topLinkDBMgr, BharosaDBQuery dbQuery) throws BharosaDBException {
       DataModifyQuery query = null;
       List args = Collections.EMPTY_LIST;
       long startTime = System.currentTimeMillis();
       try {
          AbstractSession session = (AbstractSession) topLinkDBMgr.beginSession(); +// creates a ClientSession and calls session.beginTransaction()+
          query = new DataModifyQuery();
          query.setCall(new SQLCall(dbQuery.getQueryString().replace(':', '#'))); +// we still have some SQL queries we haven't changed since we used Hibernate+
          Vector arguments = bindArgumentsForRawSql(dbQuery, query);
          args = arguments;
          query.setQueryTimeout(1);
          Object result = session.executeQuery(query, arguments);
          return converter.toInteger(result);
       } catch (BharosaDBException ex) {
          throw ex;
       } catch (Exception e) {
          throw BharosaDBException.createDBObjectQueryException(dbQuery.getQueryString(), e);
       } finally {
          topLinkDBMgr.endSession(); +// calls session.endTransaction() on the ClientSession+
          long time = System.currentTimeMillis() - startTime;
          Level level = getLogLevelForElapsedTime(time);
          if (logger.isEnabledFor(level)) {
             String message = buildPerformanceMessage(query, args);
             logPerformance(level, time, message);
    For my test, I lock a table in SQL*Plus, and there is a background process that uses this method to update that table. That process hangs until I release the lock in SQL*PLus.
    This is a corner case, though. Most of our updates are done with the UnitOfWork class, so I need to be able to make the queries that it generates time out also.
    Thanks,
    Josh

  • Oracle JDBC thin driver(10g) returns "int/smallint" as JDBC Decimal type

    Hi,
    I am using Oracle type 4 thin JDBC driver for 10g. In our code we decide
    column type by querying the database using database metadata (as code snippet below)
    DatabaseMetaData dbmd = Connection.getMetaData() ;
    ResultSet rs = dbmd. getColumns() ;
    String fieldName = rs.getString("COLUMN_NAME");
    short dataType = rs.getShort("DATA_TYPE");
    String typeName = rs.getString("TYPE_NAME");
    Now, if I have a table with datatype "integer", "smallint" etc,
    DATA_TYPE returned from above is "3" , which is in JDBC is defined constant
    for "java.sql.Types.Deciaml"
    Question is , How do i exactly get DATA_TYPE code for
    "integer" or "smallint" and not "Decimal" ?
    I have tested with few other databases with above snippet code and they do return actual DATA_TYPE as "integer" or "smallint"
    This is with Oracle 10g database and Oracle 10g thin (type4) jdbc driver.
    Thanks,
    Chirag

    user565580,
    As has been already stated, Oracle does not have data-types INTEGER or SMALLINT, only NUMBER.
    So even though Oracle lets you write INTEGER, it really creates a NUMBER.
    (As Joe mentioned.)
    Other databases don't have a NUMBER data-type, they have INTEGER, SMALLINT, etc.
    Originally, Oracle database only had three data-types:
    CHAR
    DATE
    NUMBER
    If you're going to be working with Oracle database, then you need to adapt yourself to its limitations.
    So you'll probably need to define NUMBER data-types using scale and precision.
    (As Kuassi mentioned.)
    Good Luck,
    Avi.

  • Jdbc driver creates new thread for each statement with a query timeout set

    I am profiling a web application that is using the Microsoft JDBC driver, version 1.1 to connect to a sql server 2005 database. Each java.sql.Statement that is created, within the application, gets a query timeout value set on it ( statement.setQueryTimeout(...) ).
    I have discovered that the JDBC driver creates a new thread to monitor each Statement and the query timeout value. When the application is under load these threads are getting created faster then they are being destroyed and I am concerned that this will cause a performance problem in production.
    One option I have is to remove the query timeout value and the monitor threads will not be created, another is to change JDBC drivers.
    I'm curious is there any way to control this behavior so that these threads are not created or are managed more efficiently.  Is there a workaround that anyone is aware of?   Is this considered a bug?
    I have found a similar bug here for the 2000 driver:
    http://support.microsoft.com/default.aspx/kb/894552
    Cheers

    Hi,
    Thank you for using the Microsoft SQL Server JDBC driver.  You are correct that a new thread is started to monitor the query timeout when a statement is executed.  This is a potential performance issue that we may look at addressing in the upcoming v1.2 release.  The current behavior is not configurable.  The only workaround with the v1.1 driver is to limit your use of query timeouts to only those statements which you reasonably might expect to actually time out.
    We do take customer feedback very seriously, so if anyone else is concerned about this particular issue, please chime in and we will be able to give it appropriate weight.
    --David Olix [MSFT]

  • Error [hyt00] [microsoft][odbc sql server driver] query timeout expired

    I have the below network setup:-
    1. Its a simple network at my father's office at a small town called Ichalkaranji (District - Kolhapur, Maharashtra).
    2. We are using private network range 192.168.1.xxx with two Windows Server 2003 Enterprise Edition with SP2 licensed copies and 15 local Windows 7 clients who are only using Server A.
    3. The network is having a TP-Link Braodband Router Connected to internet with the IP 192.168.1.1.
    4. Both there Windows Server 2003 Enterprise Edition with SP2 are running separate SQL Server 2005 Express with Advanced Services, you can treat them as Server A (Problematic Server with IP of 192.168.1.2) 
    and Server B (this is not having any issue with IP of 192.168.1.3).
    5. Server A is also being used by 6 Remote users from our Kolkata office using DDNS facility through the NO IP client software which installed separately on both the servers. Kolkata remote users
    do not use OR access the Server B.
    6. Server B is being used by only 2 Remote users from our Erode office (Under Salem District, Tamilnadu) using DDNS facility through the NO IP client software which installed separately on both
    the servers. Erode remote users do not use OR access the Server A.
    7. The front end application which running separately on both the servers have been developed in VB by a local vendor at Ichalkaranji (District - Kolhapur, Maharashtra).
    8. Both Servers are having the same database structure in terms of design and tables format. Only difference is that both the servers are being used separately.
    9. This error OR problem is only related to Server A, where on the clients we get the message "error [hyt00] [microsoft][odbc sql server driver] query timeout expired" every now and then.
    10. We have to frequently reboot the server whenever we get this message on the client machines. May be after rebooting every thing works perfectly for 2 hours / 5 Hours / may be one full day but
    the the error will come back for sure.
    11. Current Database back up size on Server A is around 35 GB and take around 1 hour 15 minutes daily to take the back up.
    12. Current Database back up size on Server B is around 3 GB and take around 5 to 10 minutes daily to take the back up.
    13. One thing I have noticed is that when ever we reboot Server A, for some time sqlsrvr.exe file will show memory usage of 200 to 300 MBs but it will start using slowly, what i understand is that
    this is the way SQL Server works.
    14. Both the Servers are also running Quick heal Antivirus Server Edition separate licensed copies also.
    15. Server B is also running Tally ERP 9 Licenses copy which is being used locally by 15 users of Ichalkaranji (District - Kolhapur, Maharashtra) same users
    Can any one help to resolve this issue. Any help will be highly appreciated.

    The error message "query timeout expired" occurs, because by default many APIs, including ODBC only waits for 30 seconds for SQL Server to send any output. If no data has been seen for this period of time, they tell SQL Server to cancel execution
    and return this error to the caller.
    This timeout could be seen as a token that the query is taking too long time to execute and this needs to be fixed. But it can also be a pain in the rear parts, if you are content with a report taking five minutes, because you only run it once a day.
    The simplest way to get rid of the error is to set the timeout to zero, which means "wait forever". This is something your vendor would have to do. This may, however, not resolve the problem, as the users may just find that the application is hanging.
    To wit, there are two reasons why the query takes more than 30 seconds to complete. One is that there is simply that much work to do. This can be reduced by adding indexes or by doing other tuning, if the execution time is not acceptable. The other possibility
    is blocking. That is, there is a process blocking this query from completing. This is much more likely to require attention.
    It is not clear to me, whether the vendor has developed the database part as well. In this case, you should probably call the vendor's support desk to have them to sort this out.
    Finally, I am little puzzled. You say that you are using Express Edition, but one of the databases is 35 GB in size. 35 GB is far above the limit for Express Edition.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Oracle JDBC thin driver 10g exceptions

    Can anyone tell me where I can find more resources about exceptions what I should expect if one node in cluster fails.
    Let assume that I am using WebLogic server.
    Thanks,

    We had a major problem in which we tried to roll the
    web app over to running against an Oracle database,
    and the number of open connections in our pooling
    code (that worked fine with the old database) blew up
    when lots of users started getting onto the site.
    The connections just were not being released, That statement is non-sensical.
    By definition the only point of a connection pool is to NOT release connections.
    and any JDBC calls starting spitting out exceptions,
    and the Oracle 10g thin client driver was saying that
    the maximum number of sessions were open (we were in
    the hundreds--we have a per-CPU license, so that
    shouldn't be an issue).
    We're not sure what to test right now. Whether we
    use Statements or PreparedStatements, we try to
    always close the Statement (which should close the
    ResultSet, if there is one) and then in the finally
    part of our try-catch-finally, we try to close the
    connection. Is that all we need to do? You must always close the result set first.
    Then you must always close the statement.
    Then you need to return the connection to the pool - explicitly. Usually, these days, that is done by calling the close method. It is certainly possible that your pool uses another method though.
    Can you
    think of anything we should be looking for?It is possible you have connection pool mis-configured as well.

  • Memory Leak when TOMCAT connects to Oracle 10g RAC using JDBC Thin driver.

    We had experienced Memory leak when a Oracle 10g (10.2.0.3) RAC node was evicted. TOMCAT app server is connecting to the Oracle 10g RAC database instances using JDBC 10.2.0.3 thin driver.
    Anyone had similar experience?
    Any ideas? Any bugs reported/fixed?
    Thanks,
    Raj

    If you're doing XA, we absolutely do not support
    driver-level load-balancing OR failover. Use neither.
    For non-XA, you can use driver-level failover. For
    non-XA, you could set load-balancing, but it won't
    help because we get connections from the driver,
    and keep them indefinitely, so the driver never gets
    the chance to affect which connections the pool
    uses after that.

  • DB Connection with thin driver is hanging in Oracel EM 10g

    I have couple of J2EE applications deployed in Oracel 10g EM.
    The applications build using Struts and JDBC.
    I am using java thin driver to make DB Connection
    Problem: When ever I make the db connection call, it is hanging there and not returning the db connection.
    Observation: I have verified in serverlogs, applicationlogs but nothing i found. Hence I have created a separate static class and make the jdbc connection which is very quick and working fine.
    I have ran the below command at the shell prompt: lsof -i:1521 | wc -l
    It returned 128 connections.
    I really did not uderstand what exactly went wrong here, Is there any problem with my application server or with my application.
    Kindly get back to me what exactly is the wrong here, also Please let me know if you need more information.
    Thanks in advance.
    Edited by: user7631923 on Jan 4, 2013 2:13 PM

    I have couple of J2EE applications deployed in Oracel 10g EM.
    The applications build using Struts and JDBC.
    I am using java thin driver to make DB Connection
    Problem: When ever I make the db connection call, it is hanging there and not returning the db connection.
    Observation: I have verified in serverlogs, applicationlogs but nothing i found. Hence I have created a separate static class and make the jdbc connection which is very quick and working fine.
    I have ran the below command at the shell prompt: lsof -i:1521 | wc -l
    It returned 128 connections.
    I really did not uderstand what exactly went wrong here, Is there any problem with my application server or with my application.
    Kindly get back to me what exactly is the wrong here, also Please let me know if you need more information.
    Thanks in advance.
    Edited by: user7631923 on Jan 4, 2013 2:13 PM

Maybe you are looking for

  • Cant see all meeting in monthly view

    I have Ical ver 2.0.5. When i am in monthly view some of my busy days with eventa such as all days events over lap each other so you can see all your meeting first time, you only know there is other events in that day as Ical shows some little dots a

  • How to clone a new machine from another with different hardware

    How do I clone a new Sun Blade 2500 from a Sun Blade 1000 (with Solaris8)? Is ufsdump/ufsrestore a solution? Are all needed drivers included in the kernel from the Sun Blade 1000? Or, do I first need to install patches/updates on the Sun Blade 1000?

  • Can't open apps after 8.2 update

    Can't open any installed apps except Apple ones after IOS 8.2 update. Asks for itunes password but can't connect.

  • HP Recovery Manager disappeare​d

    Hi, after repair of my Notebook HP ProBook 4530s (problems with hard ddisc) the HP Recovery Manager totaly disappeared, ESC + F11 doesnt work - HPRM simply doesn´t appear. Any idea? I wanted to reinstall my Win7... Thanks very much!

  • How can I transfer music and videos BACK TO THE COMPUTER!?!

    simply, i want to know how to put anything from my ipod back to my computer's hard drive.