This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 121186 - Can't create two connections with different versions of the same driver
Summary: Can't create two connections with different versions of the same driver
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Libor Fischmeistr
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2007-11-05 14:14 UTC by David Vancouvering
Modified: 2014-01-09 14:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch v1 (4.27 KB, patch)
2014-01-05 22:46 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Vancouvering 2007-11-05 14:14:22 UTC
Try to connect two connections to the same server using two different driver versions, with the same credentials, and
you will get an error saying "unable to create a new connection; the connection already exists"
Comment 1 Andrei Badea 2007-11-05 15:28:07 UTC
Not a defect, and probably no high priority either. I don't expect much users to do this. Consider that you discovered
the need for such a feature while testing an issue :-)
Comment 2 Jiri Rechtacek 2009-10-16 14:16:26 UTC
Reassigned to new owner.
Comment 3 matthias42 2014-01-05 22:46:20 UTC
Created attachment 143615 [details]
proposed patch v1

The equals routine in DatabaseConnection is/was broken - the attached patch moves the logic from toString to the equals Method.

This also fixes the broken equals/hashCode contract: "DB".hashCode() and "db".hashCode() are most probably not the same, but in equals the db name and other properties were first lowercased and then compared.

To allow different drivers, with same driver class, the driver name needs to taken into account while comparing (=> added into equals).

To make it editable/visible I also added the driver name to the connection properties, where currently the driver _class_ only is shown.
Comment 4 matthias42 2014-01-05 22:47:26 UTC
Changing Issue type to defect, als the equals routine is broken and the current behaviour was not sane.
Comment 5 Libor Fischmeistr 2014-01-09 14:38:44 UTC
Patch applied in changeset http://hg.netbeans.org/core-main/rev/1ff219d7fa20

Thanks for it.