commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: [dbcp] A little design help please re DBCP-100
Date Mon, 07 Aug 2006 22:06:51 GMT
You might want to look at [collections] ExtendedProperties where I just 
fixed a similar issue.

I made the instance methods work against a new instance variable, and 
subclasses could still alter the static one, which now acts as a default.


Phil Steitz wrote:
> As stated in the bug report:
> "SharedPoolDataSource.getPooledConnectionAndInfo() is synchronized 
> _instance_
> method, but it accesses SharedPoolDataSource.userKeys which is a _static_
> variable, so if you have more than one instance of SharedPoolDataSource 
> (as we
> do) access to the map would not be properly synchronized. So either map 
> should
> be made instance variable, or the method should be synchronized on the 
> class,
> not instance."
> I would very much appreciate comments on the options to fix this,
> including "WONTFIX", but I don't like that option.  I have coded the
> change to synchronize the method on the class (or more precisely, to
> make its body synchronized on the class, since it can't be static),
> but am hesitant to make that change.  Any better ideas?  Any
> recollections / rationale for why the map is static?
> Thanks!
> Phil
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message