Cannot connect to remote databases using version 10.0.2.0
NickBarrett opened this issue · 7 comments
Hi there,
I just updated to the latest NuGet package (10.0.2.0) and found I can no longer connect to remote databases (database files hosted by another server). I can only connect to a local database.
I believe the issue is in the class IBConnectionInternal. In the Connect() method, the call to _db.Attach is being passed _connectionStringOptions.Database (see here). I believe it should instead be passed _connectionStringOptions.ComposeDatabase() (which is what it was in the previous version)
I've tested with a local copy of the code and can confirm _connectionStringOptions.ComposeDatabase() works (as it includes the host name of the server in the string).
Can this please be changed back (or some other sort of fix applied)?
Thanks as always for this library.
To be clear, both of these work:
localhost:C:\Folder\Database.ib
C:\Folder\Database.ib
This however doesn't:
OtherServer:C:\Folder\Database.ib
From further testing and review of the code in version 7.13.6 I believe all references to _connectionStringOptions.Database in IBConnectionInternal should be changed to _connectionStringOptions.ComposeDatabase().
This would cover the CreateDatabase, CreateDatabaseAsync, DropDatabase, DropDatabaseAsync, Connect and ConnectAsync methods.
@NickBarrett ,
Thank you for the information. We are taking a look at it, and will get back to you soon.
Couple things here. There is more wrong with just calling Database there. If making a secure connection, the secure information is not included either. But I need to know from Sriram (I text with him in Skype regularly) about how that information is treated for Create/Drop situations. If not, then a different solution for those needs to be found.
This driver is a fork of the Firebird driver with many changes wrt InterBase (like secure connections for instance). This does match the Fb code. We have chosen for now to not do a managed version and instead always use gds32. Fb though really pushes managed over native. It looks like their native is also broken in the same way. As much as possible, I try to maintain compatibility with it for ease of integrating future fixes/updates to the driver like Async support in the latest.
I do agree on Connect and ConnectAsync. Once I hear from Sriram about Create/Drop and secure link safety, I will put it there too or get a corrected version for those 4 methods.
If you want to test an early version, drop me a message and I'll provide you with my ProGet information I stage things for testing when it is ready.
Another possible problem, all the service API might also be broken in the same way. I will probably not have a fix ready till early next week, depending on my conversations with @bsriramIdera.
Thanks @jeffovercash. I have a local copy of this repo that I'm using in the mean time.
I don't use Create/Drop or secure link so I can't comment on those.
I do have code using ConnectAsync (with the _connectionStringOptions.ComposeDatabase() fix) running in production now without issue though.