Solved

jdbc driver problem

Posted on 2006-06-14
9
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

695 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