Mike,

have a look at 

http://castor.codehaus.org/pooling.html#Jakarta-Commons-DBCP---BasicDataSource

which has details about how to use and configure DBCP with Castor and Tomcat. 
Wrt 'prepared statement cache', Gregory 
seems to be referring to the fact that DBCP is JDBC 3.0-compliant product as as 
such has to support caching of prepared 
statements. This basically allows the JDBC driver to maintain a pool of 
prepared statements across all connections.

Regards
Werner

On Sat, 30 Apr 2005 21:38:24 -0400, Mike Wannamaker wrote:

>Gregory,
>
>Do you have an example of using DBCP?  Are you using it with Tomcat at 
>all?  Not really being a SQL person, what is DBCP prepared statement cache?
>
>Gregory Block wrote:
>
>>
>>> 3. Use a Datasource instead of a Driver configuration as they  enable 
>>> connection pooling which gives you a great performance  improvement.
>>
>>
>> I highly suggest DBCP, here, with the beneficial use of prepared  
>> statement caching.
>>
>> Should you be running on a system where read performance is critical,  
>> feel free to take the SQL code generated by castor, and dumped to  
>> logs during the DB mapping load in debug output, and turn those into  
>> stored procedures that you then invoke via call to perform those  
>> loads; however, I find personally that stored procedures would be a  
>> minimal improvement over the DBCP prepared statement cache; your  
>> mileage may vary.  db.load() has performance benefits that are worth  
>> keeping, IMO, and the pleasure of having pretty stored procedures in  
>> your database is far outweighed by the nightmare of change management.
>>
>> Cheers,
>> Greg
>>
>>
>




Reply via email to