commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <>
Subject Re: [dbcp] setReadOnly always being called
Date Sun, 09 Jan 2005 21:32:46 GMT
In the 1.2 dbcp release a constructor was made available with
"Boolean defaultReadOnly" so it is possible to set it to "null".

By the way, a couple of months ago I made my own 
DBCPConnectionProvider for Hibernate. (attached)
It should compile on both Hibernate2 and 3 (if you adjust the import 

It it using the BasicDatasource implementation just like you would use 
with tomcat. The only tricky part is to copy/translate the hibernate 
property names into the dbcp names. But using this implementation you 
can use all properties defined on the configuration page without extra 


Graham King wrote:

>  Using Hibernate, DBCP and Sybase I am getting the following warning 
> from Hibernate:
>    010SK: Database cannot set connection option SET_READONLY_FALSE
>  This is because DBCP's PoolableConnectionFactory.activateObject(..) 
> method is calling 'setReadOnly' on the Connection and the database does 
> not support it. Hibernate spots the warning and logs it.
>  There is a guard in the 'activateObject' method to only call 
> setReadOnly if '_defaultReadOnly' is not null. All the constructors of 
> PoolableConnectionFactory set '_defaultReadOnly' to a 'boolean' so it 
> will never be null.
>  This goes against what the docs 
> ( say about 
> the defaultReadOnly config parameter:  "If not set then the setReadOnly 
> method will not be called".
>  Has anyone else come across this ? Is there a workaround ? Should I log 
> this as a bug ?
>  Thanks in advance,
>  Graham King.
> PS: If you replied directly to me about this topic previously could you 
> re-send please ?

View raw message