Featured Post

The great debacle of healthcare.gov

This is the first time in history when the president of the United States of America, or probably for any head of state around the world,...

Wednesday, March 5, 2008

Oracle JDBC driver bug

The following exception throws while batch updating using Hibernate 3.x with JDBC driver

at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:431)
at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDataSetImpl.java:3528)
at oracle.jdbc.driver.OraclePreparedStatement.clearParameters(OraclePreparedStatement.java:3401)

I found the solution from a posting in Oracle forum (http://forums.oracle.com/forums/thread.jspa?threadID=190963) and that says:

Oracle seems to have corrected one line in in
oracle.jdbc.dbaccess.DBData, method void clearItem(int i)

if(m_items == null && i >= m_items.length) {

if(m_items == null || i >= m_items.length) {

Another way to avoid this NPE is to avoid using the JDBC2 batch update feature.
For our (hibernate) implementation this corresponds to setting the property 'jdbc.batch_size' to zero.

No comments: