We experience a very annoying problem when trying to read a BLOB
field from Oracle 8.1.6.2.0 using TOPLink 3.6.3. I have attached the
exception stack trace that is reported to the console. As far as I can
judge a fault at oracle.sql.LobPlsqlUtil.plsql_length() happens first and
then at TOPLink.Private.DatabaseAccess.DatabasePlatform.co nvertObject().
The exception is permanently repeating that is very critical for us.

ServerSession(929808)--Connection(5625701)--SELECT LOBBODY, ID, LABEL, FK_OBJECT_ID, FK_OBJECTTYPE FROM NOTE WHERE (ID = 80020)

INTERNAL EXCEPTION STACK:
java.lang.NullPointerException
at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil. java:936)
at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil. java:102)
at oracle.jdbc.dbaccess.DBAccess.lobLength(DBAccess.j ava:709)
at oracle.sql.LobDBAccessImpl.length(LobDBAccessImpl. java:58)
at oracle.sql.BLOB.length(BLOB.java:71)
at TOPLink.Private.Helper.ConversionManager.convertOb jectToByteArray(ConversionManager.java:309)
at TOPLink.Private.Helper.ConversionManager.convertOb ject(ConversionManager.java:166)
at TOPLink.Private.DatabaseAccess.DatabasePlatform.co nvertObject(DatabasePlatform.java:594)
at TOPLink.Public.Mappings.SerializedObjectMapping.ge tAttributeValue(SerializedObjectMapping.java:43)
at TOPLink.Public.Mappings.DirectToFieldMapping.value FromRow(DirectToFieldMapping.java:490)
at TOPLink.Public.Mappings.DatabaseMapping.readFromRo wIntoObject(DatabaseMapping.java:808)
at TOPLink.Private.Descriptors.ObjectBuilder.buildAtt ributesIntoObject(ObjectBuilder.java:173)
at TOPLink.Private.Descriptors.ObjectBuilder.buildObj ect(ObjectBuilder.java:325)
at TOPLink.Private.Descriptors.ObjectBuilder.buildObj ectsInto(ObjectBuilder.java:373)
at TOPLink.Public.QueryFramework.ReadAllQuery.execute (ReadAllQuery.java:366)
at TOPLink.Public.QueryFramework.DatabaseQuery.execut e(DatabaseQuery.java:406)


I have started the application with Oracle JDBC logging on and found that the problem may originate in a possible lack of syncronization in the pooled connection implementation:

DRVR FUNC OracleConnection.isClosed() returned false
DRVR OPER OracleConnection.close()
DRVR FUNC OracleConnection.prepareCall(sql)
DRVR DBG1 SQL: "begin ? := dbms_lob.getLength (?); end;"
DRVR FUNC DBError.throwSqlException(errNum=73, obj=null)
DRVR FUNC DBError.findMessage(errNum=73, obj=null)
DRVR FUNC DBError.throwSqlException(reason="Logical handle no longer valid",

SQLState=null, vendorCode=17073)
DRVR OPER OracleConnection.close()

so the prepareCall() is issued against an already closed connection and the
call fails.

I assume we have been using a JDBC 2.0 compliant driver. We tried out
drivers that Oracle supplies for 8.1.6, 8.1.7 versions. To be true I
couldn't find any information about the JDBC specification they conform to. Does it
mean that these drivers may not be 100%-compatible with JDBC 2.0 Spec?
How can I find out if they are 2.0 compliant?
Also I have downloaded Oracle 9.2.0.1 JDBC drivers. This seemed to work
fine until we found another incompatibility which made us return back to
8.1.7 driver:

UnitOfWork(7818028)--Connection(4434104)--INSERT INTO STATUSHISTORY (CHANGEDATE, FK_SET_STATUS_ID) VALUES ({ts '2002-10-17 16:46:54.529'}, 2)

INTERNAL EXCEPTION STACK:
java.sql.SQLException: ORA-00904: invalid column name

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:2 89)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol .java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TT C7Protocol.java:1093
)
at oracle.jdbc.driver.OracleStatement.executeNonQuery (OracleStatement.jav
a:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther( OracleStatement.java
:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTi meout(OracleStatemen
t.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.execute Update(OraclePrepare
dStatement.java:589)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.ex ecuteDirectNoSelect(
DatabaseAccessor.java:906)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.ex ecuteNoSelect(Databa
seAccessor.java:960)
at TOPLink.Private.DatabaseAccess.DatabaseAccessor.ex ecuteCall(DatabaseAc
cessor.java:819)
at TOPLink.Public.PublicInterface.UnitOfWork.executeC all(UnitOfWork.java: