commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Woodhead <>
Subject Re: [dbcp] Contention for DriverManager when initializing multiple datasources WAS: Re: dbcp blocked on webapp startup
Date Tue, 01 Jul 2008 13:41:34 GMT

> 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 
> single-threaded.
> 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?
The thread dumps you saw were from before I made the datasources 
non-lazy. The build I deployed today which experienced the same problem 
had the 2 postgres datasources set to non-lazy and the mysql datasource 
left as lazy. So I find it strange that this had the same issue as, like 
you say, I would have expected the postgres datasources to be 
initialised in sequence and for this problem to go away for the postgres 
datasources but it still happened. I will mark all datasources as 
non-lazy and do another thread dump if/when it happens again.

Either way I think it should work in a multithreaded environment without 
having to make changes to the initialisation of the datasources so I 
will file a bug report like you suggested. Thanks.



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

View raw message