Solved

jdbc driver problem

Posted on 2006-06-14
9
477 Views
Last Modified: 2008-01-09
Hi,

I have following problem, please can some body tell what happend
to jdbc dirver,

06.13 14:20:39 255] : [Warn] thread [Thread-42] class
[MessageClass] Unable to process message [50128630] reason [oracle.jdb
c.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825)
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2469)
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1205)
oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559)
mypackage.database.LoggablePreparedStatement.setLong(LoggablePreparedStatement.java:158)
0
Comment
Question by:umar1farooq
  • 5
  • 4
9 Comments
 
LVL 19

Expert Comment

by:actonwang
ID: 16902273
show me your related java code.
0
 

Author Comment

by:umar1farooq
ID: 16903197

The code in class LoggablePreparedStatement

public void setLong(int parameterIndex, long x) throws SQLException {
        ensureCapacity(parameterIndex);
        this.parameters[parameterIndex] = new Long(x);
        stmt.setLong(parameterIndex, x);
    }

 private void ensureCapacity(int i) {
        if(i >= parameters.length) {
            // extend capacity
            Object[] tmp = new Object[parameters.length * 2];
            System.arraycopy(parameters, 0, tmp, 0, parameters.length);
            parameters = tmp;
        }
    }
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16903371
>> stmt.setLong(parameterIndex, x);

      how do you get the statement?


also what " SQLException" you get if that is the error? The message you show is just a [WARN] message. What stacktrace you got when error occurs?

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:umar1farooq
ID: 16905932

In our log files i found only this, nothing else,

06.13 14:20:39 255] : [Warn] thread [Thread-42] class
[MessageClass] Unable to process message [50128630] reason [oracle.jdb
c.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825)
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2469)
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1205)
oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559)
mypackage.database.LoggablePreparedStatement.setLong(LoggablePreparedStatement.java:158)

Why it is gone To oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559
from my LoggablePreparedStatement.setLong method ?
I think it is not handled by oracle.jdbc.driver.
The code in class LoggablePreparedStatement, This class is very big, i am adding only related methods to this problem,
 Query to stmt is set from other class,

PreparedStatement stmt = null;
    String statement = null;
    Connection con = null;
   
    public LoggablePreparedStatement(Connection con, String statement)
        throws SQLException {

          if (con == null ) {
                String vErrorMsg = "LoggablePreparedStatement.constructor. Passed connection == null";
                CheckedConnectionPool.makeLogMessageError ("LoggablePreparedStatement", vErrorMsg, null, null);                
                throw new NullPointerException (vErrorMsg);
          }      
          
        this.con = con;
       
        // Notice that instances of  the con variable should have, in fact, the PooledConnection type,
        // so prepareStatement to be called is from PooledConnection as well.
       
        this.stmt = con.prepareStatement(statement);
        this.statement = statement;
    }

    public void addBatch() throws SQLException {
        stmt.addBatch();
    }

public void setLong(int parameterIndex, long x) throws SQLException {
        ensureCapacity(parameterIndex);
        this.parameters[parameterIndex] = new Long(x);
        stmt.setLong(parameterIndex, x);
    }

 private void ensureCapacity(int i) {
        if(i >= parameters.length) {
            // extend capacity
            Object[] tmp = new Object[parameters.length * 2];
            System.arraycopy(parameters, 0, tmp, 0, parameters.length);
            parameters = tmp;
        }
    }
0
 
LVL 19

Accepted Solution

by:
actonwang earned 125 total points
ID: 16906159
>>Why it is gone To orac ...

    because you have

 stmt.setLong(parameterIndex, x);

   and stmt is OraclePreparedStatement. type.


Again, I don't see any error but just a warning.

Any paricular error you ran into? if do, what error message?

Or: Can you run your sql portion correctly? Any exception out of it?
0
 

Author Comment

by:umar1farooq
ID: 16909612
The stack trace code is given below.
Try {

 }catch (Exception e) {
             StackTraceElement[] elements = e.getStackTrace();
             StringBuffer buf = new StringBuffer();
             for (int a=0;a<elements.length;a++) {
                 buf.append(elements[a]).append("\n");
             }
             long mid = -1;
             if (message != null) {
                 mid = message.getId();
             }
             log.warn("Unable to process message [" + mid + "] reason [" + buf.toString() + "]");
             // add the exception to the list of exceptions occurred
             m_exceptions.addElement(e);
          }

and the following is coming in the  stack trace,
06.13 14:20:39 255] : [Warn] thread [Thread-42] class
[MessageClass] Unable to process message [50128630] reason [oracle.jdb
c.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825)
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2469)
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1205)
oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:1559)
mypackage.database.LoggablePreparedStatement.setLong(LoggablePreparedStatement.java:158)

The query is very simple,
 public static final String DELETE_SQL = "DELETE FROM MT_MESSAGE_QUEUE WHERE id = ?";
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16910451
add this below:

 log.warn("Unable to process message [" + mid + "] reason [" + buf.toString() + "]");

 log.warn("exception: ",e);

what do you see?
0
 

Author Comment

by:umar1farooq
ID: 16912160
It will take some time, to install changes to production,
This problem occured only on production.
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16912251
somehow, you missed the error message .. so I am not sure what problem you have.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best RAID for a BDD Oracle 4 69
Oracle - Create Procedure with Paramater 16 64
PL/SQL Two changes 7 28
Help on model clause 5 32
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question