commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: [dbcp] Contention for DriverManager when initializing multiple datasources WAS: Re: dbcp blocked on webapp startup
Date Tue, 01 Jul 2008 13:06:28 GMT
Adrian Woodhead schrieb:
> Simon - thanks for your feedback, what you said makes sense...
>>> The big question is: why are you running dbcp concurrently in two 
>>> different
>>> threads?
>> Two data sources within the same webapp (spring config) perhaps?
> Exactly. There are 3 actually - 2 postgres databases and one mysql 
> database, each has its own pooled datasource.

But if all the pools are initialised via Spring, and are all non-lazy 
then they should be initialised sequentially by the same spring 
initialisation thread, not in parallel. Spring initialisation is done 
via a servlet ContextListener, and that is guaranteed to be called 

But in the thread-dumps, we clearly see two threads doing driver loading 
in parallel.

Presumably some of these pooled datasources are not spring-managed?
>>> Possibly dbcp should call DriverManager.getDrivers() internally on 
>>> startup
>>> to avoid this race...
>> If this would solve it, I'd say it's a must, then.  This is a really
>> nasty race condition.
> It is. Should I file a bug? I'd be happy to try out a build with this 
> fix in it to see if it helps.

Yes, I would suggest filing a bugreport.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message