-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Cannot connect to database if there is an existing connection. [DNET1030] #943
Comments
Modified by: Joshua Ellis (ellis95)description: I have Firebird DBs on multiple industrial machines where the PLC is constantly logging data to the Firebird DB located in a Windows environment. If I use the http://ADO.net connector it refuses to connect to the database because of an existing connection. I tried this on my own computer with the same results, any connection to the database using flamerobin, the IBPP library, etc would crash the .net connection. However using the IBPP library and writing the connection works just fine with no issues. I also have code running in C++ that works fine and is able to read database contents if there are multiple connections to the database. It would be nice to see this library support multiple connections to a DB no matter what else is connected to the DB it is trying to connect to. => I have Firebird DBs on multiple industrial machines where the PLC is constantly logging data to the Firebird DB located in a Windows environment. If I use the http://ADO.net connector it refuses to connect to the database because of an existing connection. I tried this on my own computer with the same results, any connection to the database using flamerobin, the IBPP library, etc would make the .net library unusable. However using the IBPP library and writing the connection works just fine with no issues. I also have code running in C++ that works fine and is able to read database contents if there are multiple connections to the database. It would be nice to see this library support multiple connections to a DB no matter what else is connected to the DB it is trying to connect to. I am using Firebird 2.5 I have also replicated the issue with Firebird 3.0 |
Commented by: @cincuranet What does "refuses to connect" mean? You should provide a code and an error you're seeing. |
Commented by: Joshua Ellis (ellis95) Sorry forgot to include that. I will give you an error message today. |
Commented by: Joshua Ellis (ellis95) The error is 'I/O error during "CreateFile(open) operation for file "/file path/.fdb" Error while trying to open file' Inner Exception |
Commented by: @mrotteveel This sounds like a support question. My guess would be that one of the applications is connecting using an embedded connections, and the server is SuperServer mode, thus has an exclusive lock on the database. For Firebird 3 this can also happen if both applications use Embedded, because in the default config of Firebird 3, Embedded also applies SuperServer mode. For Firebird 3.0, you would need to configure the ServerMode to SuperClassic or Classic (for both embedded and normal server), for Firebird 2.5 you need to make sure Firebird Server is Classic or SuperClassic; alternatively, you need to make sure all connections go through the server and none are using an embedded connection. |
Commented by: Joshua Ellis (ellis95) Thanks Mark not sure where I would ask a support question though. Both are running Server not embedded, on the machine it is running server as well. |
Modified by: @cincuranetComponent: NuGet packages [ 10150 ] => |
Commented by: @cincuranet Yes, Mark is right. This is purely about how the connection is made and how server (or Embedded) handles that. Provider is just doing what it is told to do. In fact the error is from Firebird, not from the provider. |
Commented by: @cincuranet You can use firebird-support list (https://firebirdsql.org/en/mailing-lists/). Or alternatively StackOverflow where the Firebird community as active as well. |
Commented by: Joshua Ellis (ellis95) Thanks Mark and Jiri I will do that. It does seem it keeps trying to default to a Firebird embedded connection though I am trying to direct it at the server. I will ask the mailing lists, as this quite odd it is behaving this way. |
Commented by: @mrotteveel Since Firebird 3, connection strings that are only a file path when connecting using fbclient.dll or http://libfbclient.so will use the embedded engine if it is available. That is assuming the other application is not using the http://ADO.net provider to connect. Alternatively, you are running two different Firebird servers attempting to connect to one and the same database file. |
Commented by: Joshua Ellis (ellis95) I am not sure everything works in C++ and other connections flawlessly and I am using the default instance and I will just get missing .dll. And if I switch it back it defaults to embedded is missing. I do not want to use embedded only the server but it is not working properly on my machine for some reason. I will revert back to c++ for now as it is working with no issues |
Commented by: @mrotteveel The default of the http://ADO.net provider uses the wire protocol to connect to a server, and does not use embedded unless you explicitly set the ServerType in the connection string, which specifies whether the provider connects using the wire protocol or uses Firebird Embedded. The ServerType in the connection string does not relate to the server mode I mentioned in my earlier comment. Server mode is a specific installation of the engine (Firebird 2.5 and earlier), or a configuration in firebird.conf (Firebird 3 and higher). Unless you were already using ServerType=Embedded in your connection string, your problem is likely that your *other* application is using Firebird Embedded, or you're using two Firebird servers trying to access the same database. |
Commented by: Joshua Ellis (ellis95) Thanks Mark, the only thing that it could be is they are using two different servers as the database itself is using the regular server instance for 2.5. The http://ADO.net connection states that the server doesn't exist even though everything is installed and set up by default settings. But the server exist as the database works fine, trying to redirect the .net connector to the server has not worked yet. |
Commented by: Joshua Ellis (ellis95) This is why I assumed it was a bug it is not using the default instance of the server and I have been unable to force it to do so. |
Commented by: @mrotteveel Could you please take this to https://groups.google.com/g/firebird-net-provider? |
Commented by: Joshua Ellis (ellis95) Done, thanks Mark |
Submitted by: Joshua Ellis (ellis95)
I have Firebird DBs on multiple industrial machines where the PLC is constantly logging data to the Firebird DB located in a Windows environment. If I use the http://ADO.net connector it refuses to connect to the database because of an existing connection. I tried this on my own computer with the same results, any connection to the database using flamerobin, the IBPP library, etc would make the .net library unusable. However using the IBPP library and writing the connection works just fine with no issues. I also have code running in C++ that works fine and is able to read database contents if there are multiple connections to the database. It would be nice to see this library support multiple connections to a DB no matter what else is connected to the DB it is trying to connect to. I am using Firebird 2.5 I have also replicated the issue with Firebird 3.0
The text was updated successfully, but these errors were encountered: