I have a problem with JDBC-client thin driver, which I can not solve.I use the following Java code:
*
String sql="SELECT ID, SMILES, NO_ATOMS, NO_BONDS" +
" COORD_STRING,SCREEN_VECTOR " +
" FROM MOL_GLOBAL " +
" WHERE ID=" + nID+ " FOR UPDATE";
//-------- nID is a string ------
try { //========================= SQL try
dbConnection.setAutoCommit(false);
infoMsg="ERROR: deriving ResultSet ";
//=========================================================================
ResultSet RS=dbStatement.executeQuery(sql);
//=========================================================================
infoMsg="ERROR: deriving BLOB locator ";
//=========================================================================
OracleResultSet oRS=(OracleResultSet)RS;
oRS.next();
oracle.sql.BLOB bLob=oRS.getBLOB("SCREEN_VECTOR"
//=========================================================================
infoMsg="ERROR: writing into BLOB ";
//dbStatement.execute("LOCK TABLE MOL_GLOBAL IN ROW" +
// " EXCLUSIVE MODE"
bLob.putBytes(1, bytelen);
/* After this statement an ERROR is issued:
ERROR: ORA-22920: row containing the LOB value
is not locked */
bLob.putBytes(3, bsv.getBits());
oRS.updateBlob("SCREEN_VECTOR",bLob));
dbConnection.commit();
} catch (SQLException sqlE) { //------------------- SQL
infoMsg=infoMsg+sqlE.getMessage();
tools.writeToLogFile(infoMsg);
} //---------------------------------------------- SQL
and as shown I recieve an Error in atempting to write into BLOB. The error is:
ERROR: ORA-22920: row containing the LOB value
is not locked
thou I use SELECT FOR UPDATE which has to lock the rows. Even explicitely locking by:
dbStatement.execute("LOCK TABLE MOL_GLOBAL IN ROW" +
" EXCLUSIVE MODE"
does not help.
Have somebody an idea where is my mistake?
*
String sql="SELECT ID, SMILES, NO_ATOMS, NO_BONDS" +
" COORD_STRING,SCREEN_VECTOR " +
" FROM MOL_GLOBAL " +
" WHERE ID=" + nID+ " FOR UPDATE";
//-------- nID is a string ------
try { //========================= SQL try
dbConnection.setAutoCommit(false);
infoMsg="ERROR: deriving ResultSet ";
//=========================================================================
ResultSet RS=dbStatement.executeQuery(sql);
//=========================================================================
infoMsg="ERROR: deriving BLOB locator ";
//=========================================================================
OracleResultSet oRS=(OracleResultSet)RS;
oRS.next();
oracle.sql.BLOB bLob=oRS.getBLOB("SCREEN_VECTOR"
//=========================================================================
infoMsg="ERROR: writing into BLOB ";
//dbStatement.execute("LOCK TABLE MOL_GLOBAL IN ROW" +
// " EXCLUSIVE MODE"
bLob.putBytes(1, bytelen);
/* After this statement an ERROR is issued:
ERROR: ORA-22920: row containing the LOB value
is not locked */
bLob.putBytes(3, bsv.getBits());
oRS.updateBlob("SCREEN_VECTOR",bLob));
dbConnection.commit();
} catch (SQLException sqlE) { //------------------- SQL
infoMsg=infoMsg+sqlE.getMessage();
tools.writeToLogFile(infoMsg);
} //---------------------------------------------- SQL
and as shown I recieve an Error in atempting to write into BLOB. The error is:
ERROR: ORA-22920: row containing the LOB value
is not locked
thou I use SELECT FOR UPDATE which has to lock the rows. Even explicitely locking by:
dbStatement.execute("LOCK TABLE MOL_GLOBAL IN ROW" +
" EXCLUSIVE MODE"
does not help.
Have somebody an idea where is my mistake?