RAR5074 exception against Oracle8.1.7 and Sun App Server PE 8.2

Folks,

I have seen some posts floating around re: this problem but haven't been able to get specifics regarding this problem. would greatly appreciate if someone is able to give me a hand with this issue.

Background:

I have an app running inside the Sun Java App Server PE8.2, talking to an oracle8.1.7 backend via the container pool, using Oraclejdbc14.jar

This is how I have set up my pool:

=====================================================

Datasource Classname: oracle.jdbc.pool.OracleDataSource

Resource Type:javax.sql.ConnectionPoolDataSource

Pool Settings:

Initial and Minimum Pool Size: 2

Maximum Pool Size:10

Pool Resize Quantity:2

Idle Timeout:300

Max Wait Time: 60000

Connection Validation

Connection Validation: Required

Validation Method:table

Table Name:DUAL

On Any Failure: Close All Connections

And here is my Code to retrieve the Connection

Context context =new InitialContext();

m_Logger.debug("Connecting to JNDI: " + jndi);

dataSource = (DataSource)context.lookup(jndi);

sqlConnection = dataSource.getConnection();

m_OracleConnection = (OracleConnection) dataSource.getConnection(sqlConnection);

if (m_OracleConnection ==null)

{

thrownew CoreDBConnectionException("Connection retrieved is null");

}

Now the application works just fine, I have no issues reading or writign data to the database, however if i look at the server log there are numerous exceptions as below

[#|2006-05-24T14:42:05.328+0800|SEVERE|sun-appserver-pe8.2|javax.enterprise.resource.resourceadapter|_ThreadID=14;|RAR5074 : Exceptionwhile executing prepared statement|#]

If i use a plain java.sql.DataSource everything is fine i.e. i don;t get the exceptions anymore but i am forced to use the sun datasource because i am using Clobs in my app and in order to create Temporary Clob, it needs an implicit OracleConnection.

has anyone come across this issue before, if yes have you been able to resolve this? Also does anyone have any other options of wrting Clobs to databse without actually creating a temporary clob?

Any help is much appreciated

Thanks in Advance,

Dushy

[2623 byte] By [dushys] at [2007-11-26 7:27:42]
# 1

Application Server tries to match existing connections in the pool to serve the connection request from the client. Exception is thrown during that time and is being logged.

However, the application will work fine.

1) Can you try a standalone program (without appserver) which uses clob from oracle and see whether any exceptions are thrown ?

2) What is the driver you are using ? and its version ?

(To know the driver version,

get a connection and print the following:

1) conn.getMetaData().getDriverMajorVersion()

2) conn.getMetaData().getDriverMinorVersion()

Check whether this driver is supported for your oracle database version (8.1.7) in your case.

Thanks,

-Jagadish

JagadishPrasath at 2007-7-6 19:18:03 > top of Java-index,Application & Integration Servers,Application Servers...
# 2

Hi Jagdish,

Thanks for the reply. I haven't tested this in a standalone client but then again I am not sure what i would be achieving by doing so since i am trying to resolve an issue with the Connection Pool itself.

Also seriously doubt that this is an issue with the JDBC driver. I was using Classes12.jar before, upgraded to OJDBC14.jar and that didn;t make a difference.

For some reason it seems that all the connections in the pool are failing validation for some reason. I might try removing all validation and see if this works.

Thanks again.

Dushy

dushys at 2007-7-6 19:18:03 > top of Java-index,Application & Integration Servers,Application Servers...
# 3

Folks,

After a week's worth of reasearch and trial and error, I finally found the fix to this issue.

The problem lied with closing the actual phsyical Oracle Connection which apparently upsets the Connection Pool. So for those using pre Oracle 10G and have to create Temporary Clobs, you will know that you need to create an OracleConnection to be able to do so.

you probably would be doing

com.sun.appserv.jdbc.DataSource ds = (com.sun.appserv.jdbc.DataSOurce) ic.lookup("jdbc/OracleDB");

Connection logicalConnection = ds.getConnection();

// This returns the logical connection from the pool. That will be sun specific.

Connection physicalConnection = ds.getConnection(con);

//This will return the physical connection. That will be oracle connection.

Once you are done with the connection, make sure that you close the logicalConnection, rather than physical connection. Otherwise your risk upsetting the connection pool

Cheers

Dushy

dushys at 2007-7-6 19:18:03 > top of Java-index,Application & Integration Servers,Application Servers...