Oops...I meant "what the Firebird and MySql folks were thinking when implementing ICloneable."


On 5/19/05, Roberto R <[EMAIL PROTECTED]> wrote:
That code change was just for Sunil to try out Firebird in his test project.  Aside from MySql.Data, the other providers tested don't seem to have a problem with cloning connections that don't have connectionstrings set.  Still, it is sortof odd to return a clone when there's no conn string set which is probably what the MySql and Npgsql folks were thinking when implementing ICloneable.

Roberto


On 5/19/05, Ron Grabowski < [EMAIL PROTECTED]> wrote:
Hrmm, the _templateConnectionIsICloneable optimization might not be as
useful as I thought it was. It looks like there's a good chance
CreateInstance will be called in almost every case. When the connection
provider is first loaded its ConnectionString is most likely null or
the empty.string already. I don't recall seeing code in the source
where the _templateConnection's ConnectionString property is every set.
There's no SetTemplateConnectionString method. I believe its the
calling function's (the method that calles GetConnection())
responsibility to ensure a proper connection string. Perhaps its
simpler to just revert to the original code:

return (IDbConnection)
Activator.CreateInstance(_templateConnection.GetType());


Reply via email to