mrotteveel / netlogo-sql

This extension adds database access to the NetLogo modelling language.
2 stars 0 forks source link

Settings of sql:connect overwrite defaults #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using sql:connect overwrites the default connection settings, so repeatedly 
calling sql:connect assuming defaults will go wrong because it will use values 
set during previous calls to sql:connect.

For example:
Doing
sql:connect [["brand" "generic"] ["driver" "org.postgresql.Driver"] ["jdbc-url" 
"jdbc:postgresql://localhost/sqlwrappertest"] ["user" "test"] ["password" 
"testpassword"]]

and then
sql:connect [["database" "sqlwrappertest"] ["user" "test"] ["password" 
"testpassword"]]

This will connect to the postgresql database using the jdbc-url, not to the 
MySQL database as expected based on documented defaults

Original issue reported on code.google.com by MHGRotte...@gmail.com on 8 May 2011 at 2:05

GoogleCodeExporter commented 9 years ago
Clone() functionality used created a shallow copy of SqlSetting, and did not 
clone the internal settings HashMap

Original comment by MHGRotte...@gmail.com on 4 Jun 2011 at 8:16

GoogleCodeExporter commented 9 years ago
Fixed issue, added test to check for this behavior + minor refactoring to 
improve cohesion

Original comment by MHGRotte...@gmail.com on 4 Jun 2011 at 9:00

GoogleCodeExporter commented 9 years ago

Original comment by MHGRotte...@gmail.com on 9 Jul 2011 at 1:57