umar1farooq
asked on
jdbc driver problem
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._ createOrGe tDBItem(DB DataSetImp l.java:825 )
oracle.jdbc.dbaccess.DBDat aSetImpl.s etBytesBin dItem(DBDa taSetImpl. java:2469)
oracle.jdbc.driver.OracleP reparedSta tement.set Item(Oracl ePreparedS tatement.j ava:1205)
oracle.jdbc.driver.OracleP reparedSta tement.set Long(Oracl ePreparedS tatement.j ava:1559)
mypackage.database.Loggabl ePreparedS tatement.s etLong(Log gablePrepa redStateme nt.java:15 8)
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._
oracle.jdbc.dbaccess.DBDat
oracle.jdbc.driver.OracleP
oracle.jdbc.driver.OracleP
mypackage.database.Loggabl
show me your related java code.
ASKER
The code in class LoggablePreparedStatement
public void setLong(int parameterIndex, long x) throws SQLException {
ensureCapacity(parameterIn
this.parameters[parameterI
stmt.setLong(parameterInde
}
private void ensureCapacity(int i) {
if(i >= parameters.length) {
// extend capacity
Object[] tmp = new Object[parameters.length * 2];
System.arraycopy(parameter
parameters = tmp;
}
}
>> stmt.setLong(parameterInde x, 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?
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?
ASKER
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._
oracle.jdbc.dbaccess.DBDat
oracle.jdbc.driver.OracleP
oracle.jdbc.driver.OracleP
mypackage.database.Loggabl
Why it is gone To oracle.jdbc.driver.OracleP
from my LoggablePreparedStatement.
I think it is not handled by oracle.jdbc.driver.
The code in class LoggablePreparedStatement,
Query to stmt is set from other class,
PreparedStatement stmt = null;
String statement = null;
Connection con = null;
public LoggablePreparedStatement(
throws SQLException {
if (con == null ) {
String vErrorMsg = "LoggablePreparedStatement
CheckedConnectionPool.make
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(state
this.statement = statement;
}
public void addBatch() throws SQLException {
stmt.addBatch();
}
public void setLong(int parameterIndex, long x) throws SQLException {
ensureCapacity(parameterIn
this.parameters[parameterI
stmt.setLong(parameterInde
}
private void ensureCapacity(int i) {
if(i >= parameters.length) {
// extend capacity
Object[] tmp = new Object[parameters.length * 2];
System.arraycopy(parameter
parameters = tmp;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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]).ap pend("\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._ createOrGe tDBItem(DB DataSetImp l.java:825 )
oracle.jdbc.dbaccess.DBDat aSetImpl.s etBytesBin dItem(DBDa taSetImpl. java:2469)
oracle.jdbc.driver.OracleP reparedSta tement.set Item(Oracl ePreparedS tatement.j ava:1205)
oracle.jdbc.driver.OracleP reparedSta tement.set Long(Oracl ePreparedS tatement.j ava:1559)
mypackage.database.Loggabl ePreparedS tatement.s etLong(Log gablePrepa redStateme nt.java:15 8)
The query is very simple,
public static final String DELETE_SQL = "DELETE FROM MT_MESSAGE_QUEUE WHERE id = ?";
Try {
}catch (Exception e) {
StackTraceElement[] elements = e.getStackTrace();
StringBuffer buf = new StringBuffer();
for (int a=0;a<elements.length;a++)
buf.append(elements[a]).ap
}
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._
oracle.jdbc.dbaccess.DBDat
oracle.jdbc.driver.OracleP
oracle.jdbc.driver.OracleP
mypackage.database.Loggabl
The query is very simple,
public static final String DELETE_SQL = "DELETE FROM MT_MESSAGE_QUEUE WHERE id = ?";
add this below:
log.warn("Unable to process message [" + mid + "] reason [" + buf.toString() + "]");
log.warn("exception: ",e);
what do you see?
log.warn("Unable to process message [" + mid + "] reason [" + buf.toString() + "]");
log.warn("exception: ",e);
what do you see?
ASKER
It will take some time, to install changes to production,
This problem occured only on production.
This problem occured only on production.
somehow, you missed the error message .. so I am not sure what problem you have.