|
From: Bertrand R. <ber...@mo...> - 2004-05-25 18:18:49
|
I agree with Christian, it is probably better to use the identity of the underlying connection. Moreover, AFAIK the JDBC specs don't say anything special about = "connection equality" - does it ? And even if it does, someone using a connection pool would be crazy to = base his code on such equality... This would not be portable at all and would strongly depend on the pool implementation. -bertrand ----- Original Message ----- From: Craig Servin <cs...@cr...> Date: Tue, 18 May 2004 22:50:06 -0500 To: pro...@li... Subject: Re: [Proxool-developer] Connection Equality > On Tuesday 18 May 2004 15:56, Bill Horsman wrote: > > However, I wonder whether it will cause problems with some systems.=20 > > Christian, some of your/my code relies on being able to identify the = > > same connection being used in a Map doesn't it? Any thoughts? >=20 > It is a little bit strange to have equals() guarantee that it is the=20 > same > connection. I usually count on equals() to tell me something about logical=20 > equality and =3D=3D to see if something is really the same object. Your points are valid, but in pratice this will create problems for = external code that wants to reuse resources tied to a connection. For example: We use a lot of clobs. Instead of creating a new clob each time we call = our procedures (up to 40 times a second) we tie a clob to a connection and = reuse the same clob each time. This is done by simply using the connection as = the key in a thread safe hash map. So, for this reason I suggest that the wrapper uses the identity of the underlying connection. CHR CHR --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now = for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=3D2562&alloc_id=3D6184&op=3Dclick _______________________________________________ Proxool-developer mailing list Pro...@li... https://lists.sourceforge.net/lists/listinfo/proxool-developer |