Hello All just for info.
It does not look like bug but more like a small missing feature :) .
A support of Oracle thin driver 10 does not exist in Ojb. It could be nice
to have it in Obj 1.0 because normally ( just reading the documentation ) ,
there is is a lot of performance improvement
on those drivers.
Trying to use platform Oracle with 10.1 driver work fine except for blob
and clob ( 2kb limitation )
Trying to use platform Oracle9i support with 10.1 driver dump this exception
:
Caused by: org.apache.ojb.broker.accesslayer.LookupException: Platform
dependent initialization of connection failed
at
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.initializeJd
bcConnection(ConnectionFactoryAbstractImpl.java:157)
at
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnectio
nFromDriverManager(ConnectionFactoryAbstractImpl.java:272)
at
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFactory
.makeObject(ConnectionFactoryPooledImpl.java:230)
at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo
l.java:816)
at
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnectionF
romPool(ConnectionFactoryPooledImpl.java:81)
... 12 more
Caused by: org.apache.ojb.broker.platforms.PlatformException: Class
org.apache.ojb.broker.platforms.PlatformOracle9iImpl can not access a member
of class oracle.jdbc.driver.PhysicalConnection with modifiers "public
synchronized"
at
org.apache.ojb.broker.platforms.PlatformOracle9iImpl.initializeJdbcConnectio
n(PlatformOracle9iImpl.java:110)
at
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.initializeJd
bcConnection(ConnectionFactoryAbstractImpl.java:153)
... 16 more
Caused by: java.lang.IllegalAccessException: Class
org.apache.ojb.broker.platforms.PlatformOracle9iImpl can not access a member
of class oracle.jdbc.driver.PhysicalConnection with modifiers "public
synchronized"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57)
at java.lang.reflect.Method.invoke(Method.java:317)
at
org.apache.ojb.broker.platforms.PlatformOracle9iImpl.initializeJdbcConnectio
n(PlatformOracle9iImpl.java:105)
... 17 more
For make it work replace in the initializeJdbcConnection =>
methodSetStatementCacheSize = ClassHelper.getMethod(OracleConnection.class,
"setStatementCacheSize", PARAM_TYPE_INTEGER);
methodSetImplicitCachingEnabled =
ClassHelper.getMethod(OracleConnection.class, "setImplicitCachingEnabled",
PARAM_TYPE_BOOLEAN);
It's a bit ugly because it add dependency on the Oracle driver ( may be
something like :
methodSetStatementCacheSize =
ClassHelper.getMethod(Class.forName("oracle.jdbc.OracleConnection"),
"setStatementCacheSize", PARAM_TYPE_INTEGER);
methodSetImplicitCachingEnabled =
ClassHelper.getMethod(Class.forName("oracle.jdbc.OracleConnection"),
"setImplicitCachingEnabled", PARAM_TYPE_BOOLEAN);
is more relevant ) .
After this it still not working due to the following exception :
[org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR: Platform
dependend failure
Could not set escape processing
.....
Caused by: java.sql.SQLException: Attempt to set Escape Processing after SQL
is already processed
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
at oracle.jdbc.driver.OracleSql.setEscapeProcessing(OracleSql.java:343)
at
oracle.jdbc.driver.OraclePreparedStatement.setEscapeProcessing(OraclePrepare
dStatement.java:3190)
at
org.apache.ojb.broker.platforms.PlatformOracleImpl.afterStatementCreate(Plat
formOracleImpl.java:59)
So i did remove the afterStatementCreate which is setting the
EscapeProcessing even for prepare statement ( cf : java.sql.Statement =>
setEscapeProcessing : Note: Since prepared statements have usually been
parsed prior to making this call, disabling escape processing for
PreparedStatements objects will have no effect. )
if(!(stmt instanceof PreparedStatement)){
super.afterStatementCreate(stmt);
}
After that it seems to work .
B.R
Thierry