Hashtable used incorrectly, possible reliability loss
-----------------------------------------------------

                 Key: DNET-230
                 URL: http://tracker.firebirdsql.org/browse/DNET-230
             Project: .NET Data provider
          Issue Type: Bug
          Components: ADO.NET Provider
    Affects Versions: 2.5.0 Beta 2, 2.1.0
         Environment: not applicable
            Reporter: Stefan Schultze
            Assignee: Jiri Cincura
            Priority: Minor


Hashtable uses the GetHashCode() method internally to determine if a specified 
key *might* exist in the table, plus where a specified key *would* be found if 
it exists. It then looks for the actual key.

FbPoolManager and FbConnectionPool use Hashtable in an incorrect way. They 
first call GetHashCode on the connection string, and then pass that to the 
Hashtable.

Consequence: If two connection strings have the same hash code (unlikely, but 
indeed possible!), the connection pool might return the wrong connection.

Simple workaround: Use the connection string as the Hashtable key, not its hash 
code. Exactly as fast, but reliable.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to