Re: Exception : ResultSet is from UPDATE. No Data

From: Mark Collins (markcollins_at_bigfoot.com)
Date: 10/23/03

  • Next message: Cober: "MySQL-JBuilder"
    Date: Wed, 22 Oct 2003 22:39:07 GMT
    
    

    Are you sure that only one thread is using the connection and cached
    preparedStatement at a time? Maybe two threads get the same statement and
    are overstepping each other, or if two threads are using the same connection
    then the commit status of one might be stepping on the processing of the
    other. It might be hard to catch - only happens when the moon is full,
    etc...

    "Chithu" <chitrapandian@yahoo.com> wrote in message
    news:9eb838c3.0310202011.56b565df@posting.google.com...
    > Dear All,
    >
    > Database product version=3.23.41
    > Database driver name=MySQL-AB JDBC Driver
    > Database driver version=3.0.8-stable ( $Date: 2003/05/19 00:57:19 $,
    > $Revision: 1.27.2.18 $ )
    >
    > Our application is an Multi-Threaded Java based application and uses 6
    > MySQL connections to do various database transactions, and also we
    > maintain PreparedStatement cache (200 per Connection), meaning we
    > cache the PreparedStatement based on the SQL in a cache and use that
    > cached PS for subsequent db operations.
    >
    > We are sure that, all are "SELECT" SQLs executed using executeQuery
    > methos, no other SQLs and also Database Connection are in normal state
    > only.
    >
    > Now, we are continously facing this after running our for 2-3 hrs., we
    > are not sure where the problem is, following are the various
    > exceptions
    > thrown continously and the complete database is corrupted with invalid
    > data, now the only way to recover from this is to reinitialise and
    > restart our
    > application.
    >
    > This is an highly critical issue. Kindly, guide us to debug the
    > problem @ the earliest.
    >
    > -----------------------------------------------
    >
    > 22:33:39:995 PM java.sql.SQLException: Column Index out of range ( 3 >
    > 1).
    > 22:33:39:995 PM at
    com.mysql.jdbc.ResultSet.getString(ResultSet.java:1749)
    > 22:33:39:995 PM at
    com.adventnet.nms.store.relational.RelationalObject$ForUserPropGet.fillUserP
    roperties(RelationalObject.java:1761)
    > 22:33:39:995 PM at
    com.adventnet.nms.store.relational.RelationalObject.getObject(RelationalObje
    ct.java:602)
    > ...
    > ...
    >
    > 22:34:09:467 PM java.sql.SQLException: Column 'status' not found.
    > 22:34:09:467 PM at
    com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:2257)
    > 22:34:09:467 PM at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:1279)
    > 22:34:09:467 PM at
    >
    com.adventnet.me.opmanager.server.poll.InterfaceDataCalculator.queryAndGetIn
    terfaceStatus(InterfaceDataCalculator.java:87)
    > .....
    > .....
    >
    > 22:34:09:547 PM java.lang.NullPointerException
    > 22:34:09:547 PM at com.mysql.jdbc.ResultSet.first(ResultSet.java:2283)
    > 22:34:09:547 PM at
    >
    com.adventnet.me.opmanager.server.poll.InterfaceDataCalculator.queryAndGetIn
    terfaceStatusPortObjectStatus(InterfaceDataCalculator.java:138)
    >
    > 22:34:09:547 PM at
    com.adventnet.me.opmanager.server.poll.InterfaceDataCalculator.changeCollect
    edInfo(InterfaceDataCalculator.java:53)
    > 22:34:09:547 PM at
    com.adventnet.me.opmanager.server.poll.OpManagerDataDecoder.decode(OpManager
    DataDecoder.java:108)
    > ...
    >
    > 22:35:00:861 PM java.sql.SQLException: Can not issue
    > INSERT/UPDATE/DELETE with executeQuery()
    > 22:35:00:861 PM at
    com.mysql.jdbc.Statement.executeQuery(Statement.java:1161)
    > 22:35:00:861 PM at
    com.adventnet.nms.db.util.SQLQueryGenerator.getResult(SQLQueryGenerator.java
    :2103)
    > 22:35:00:861 PM at
    com.adventnet.nms.db.util.SQLQueryGenerator.executeQuery(SQLQueryGenerator.j
    ava:1934)
    >
    >
    > 22:35:13:639 PM java.sql.SQLException: Column 'NAME' not found.
    > 22:35:13:639 PM at
    com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:2257)
    > 22:35:13:639 PM at
    com.adventnet.db.util.ResultSetWrapper.getString(ResultSetWrapper.java:161)
    > 22:35:13:639 PM at
    com.adventnet.nms.db.util.SQLQueryGenerator.getResult(SQLQueryGenerator.java
    :2164)
    > ...
    >
    >
    > 22:35:31:214 MAP: SQLException : java.sql.SQLException: Invalid value
    > for getInt() - 'spp-test6_Oracle_1521' at:
    > java.sql.SQLException: Invalid value for getInt() -
    > 'spp-test6_Oracle_1521'
    > at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:1266)
    > at com.adventnet.nms.store.DBVector.contains(DBVector.java:631)
    > at com.adventnet.nms.mapdb.MapHandler.mapExists(MapHandler.java:577)
    > ...
    >
    > 22:33:40:215 PM java.sql.SQLException: ResultSet is from UPDATE. No
    > Data
    > 22:33:40:215 PM at com.mysql.jdbc.ResultSet.next(ResultSet.java:2416)
    > 22:33:40:215 PM at
    com.adventnet.db.util.ResultSetWrapper.next(ResultSetWrapper.java:102)
    > 22:33:40:215 PM at
    com.adventnet.nms.store.relational.RelationalObject.formProperties(Relationa
    lObject.java:612)
    > ----------------------------------------------------------------
    >
    > Could be please let us know, is there any issues in MySQL Result set
    > or is there any wrong sequence that we are doing ... ?.
    >
    > Because, it works fine in normal condition, at times this particular
    > Exception is thrown, can you please explain the possible causes for
    > this particular
    > Exception (ResultSet is from UPDATE. No Data & Can not issue
    > INSERT/UPDATE/DELETE with executeQuery()) ? or is there any
    > possibility of changing the state of the Resultset in middle of the
    > processing ??.
    >
    > This occurs only if the resultsets reallyResult() returns false, on
    > tracing the source code, what will be the cause for this ?
    >
    > ANybody .. know when it will happen ..!
    > Any help to resolve this issue is really appreciated.
    >
    > Thanks in advance for your help
    >
    > Regards,
    > Chitrapandian N


  • Next message: Cober: "MySQL-JBuilder"

    Relevant Pages

    • Re: why not SQL Authentication?
      ... >> website thru database) is that connections can't be pooled. ... you can't share/pool that connection. ... >> so in essence you need to cache data. ... then open the command object again. ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Sleepy database
      ... The PHP has to connect to the database ... using the TCP connection on first connect. ... Alternatively it could be the cache on the database server. ...
      (comp.lang.php)
    • Re: [PHP] PHP+MySQL website cache ? Yes/No
      ... This benchmark is not very accurate, but you are right the database connection took most of the time. ... Shopping cart is stored in session - not in database. ... One way or another I will always need to connect do database (I cannot cache 300 products in 300 files, ...
      (php.general)
    • Re: why not SQL Authentication?
      ... you're going to have to go to the database to get your data. ... Now what doesn't make sense is for me is to close the command object, ... Why wouldn't I just cache that command object so ... that I could just reuse it again without having to set a connection object ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Prepared stmt vs Connection Pooling
      ... So the way this works is you create the PreparedStatement afresh each ... time you get a new connection from the pool, ... Yes it is important to use a JDBC pool that correcly handles a cache of PreparedStatement. ...
      (comp.lang.java.databases)