New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloning FbConnection without connection string throws exception [DNET141] #151
Comments
Modified by: @cincuranetdescription: If you tryt o run this code FbConnection fbConnection = new FbConnection(); it will throw exception. It's because if we create FbConnection without connection string in ctor, we're internally assigning empty string. But when cloning the connection, we put property to ctor and then this is validated and fails. I suppose: => If you try to run this code FbConnection fbConnection = new FbConnection(); it will throw exception. It's because if we create FbConnection without connection string in ctor, we're internally assigning empty string. But when cloning the connection, we put property to ctor and then this is validated and fails. I suppose: |
Modified by: @cincuranetdescription: If you try to run this code FbConnection fbConnection = new FbConnection(); it will throw exception. It's because if we create FbConnection without connection string in ctor, we're internally assigning empty string. But when cloning the connection, we put property to ctor and then this is validated and fails. I suppose: => If you try to run this code FbConnection fbConnection = new FbConnection(); it will throw exception. It's because if we create FbConnection without connection string in ctor, we're internally assigning empty string. But when cloning the connection, we put property to ctor and then this is validated and fails. I suppose: |
Modified by: @cincuranetstatus: Open [ 1 ] => In Progress [ 3 ] |
Modified by: @carlosgastatus: In Progress [ 3 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5.0 [ 10170 ] |
Submitted by: @cincuranet
If you try to run this code
FbConnection fbConnection = new FbConnection();
FbConnection fbConnection1 = (FbConnection)((ICloneable)fbConnection).Clone();
it will throw exception.
It's because if we create FbConnection without connection string in ctor, we're internally assigning empty string. But when cloning the connection, we put property to ctor and then this is validated and fails. I suppose:
* to test in Clone method whether connection string is empty (or null) and if so create FbConnection with null in ctor param [this is least painful solution]
OR
* not to assing internally empty string but leave it null (if no connection string has been provided) [this is maybe a bit more clear solution, but needs to review code on various place, whether something doesn't depends on empty connection string]
Commits: ebdc4c0
The text was updated successfully, but these errors were encountered: