Nice work,

many thanks.

cheers
danilo


Danilo Tommasina wrote:

I ended up implementing a custom DBCP connection factory that is using a BasicDataSource instead of a PooledDataSource. Since the documentation of the DBCP stuff is really ugly I didn't find out what the difference really is between the PooledDataSource and the BasicDataSource. Fact is that with the BasicDataSource based implementation the problem with the MAX_OPEN_CURSORS is solved, because a fixed-size PreparedStatement cache is used.


I had a look in DBCP CVS and the BasicDataSource is really only a specialiced implementation of PooledDataSource with more user-friendly getter/setters. It will use AbandonedObjectPool or GenericObjectPool for connection "storage".

With PooledDataSource you can choose any underlying pool you want and just supply a factory that could eg return your own pool implementations. (But you have no "nice" setter like setMaxIdle, since you can't rely on any specifics on the object pool.)

I think it makes sence to keep PooledDataSource in OJB, which enables the configuration to be more generic in OJB1.1.

However, I was able to work around the MAX_OPEN_CURSORS error by adding a check in the default DBCP connection factory: if platform is Oracle9i then don't use DBCP PreparedStatement caching. After fixing so that the factory calls initializeJdbcConnection properly, this allows the Oracle9i platform impl to manage the statement caching.

Note that it is necessary to implement/override also the releaseAllResources() method for closing the pooled connections on application shutdown.


This is now fixed in the DBCP factory in CVS.

These changes are only in OJB_1_0_RELEASE branch yet, I will now merge them with head.

Regards,
 Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to