Subject AW: [firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.
Author Arno Peter

Thanks for your answers.

 

> Describe what you want to achieve in real life and someone will advise

> you about the best model for your requirements.

Thanks that would be great.

I have a Delphi application which ships with  firebird embedded and a service.

The service fills the db with the data and the Application is the GUI where the user can configure and use the service to fill the db or to receive data from the db in order to display it in the GUI .

The installer installs the service and also places the firebird embedded files in a subfolder of the installation directory.

Both, the service and multiple instances of my application should be able to connect to the same database at the same time.

The server is set to SuperClassic ( I also tried the 'Classic' mode).

Both, the service and the application are installed locally on the same pc.

After the installation and the configuration of a database I am able to connect to the db with the service.

I am also able to simultaneously connect to the same db(while the service is also connected) if I run my Application.exe via 'Run as Administrator' (I can connect to the same db with multiple instances of my application

as long as all of the instances are started via 'Run as Administrator'). Everything works fine, but as soon as I open an instance of my application in non-elevated mode, I receive the message

"[ODBC Firebird Driver]Database is probably already opened by another engine instance on another Windows session."

I have also stopped the service and closed all instances. Then I opened my Application in 'normal' non-elevated mode and I am able to connect to the db.

Similar to the describe behaviour above I am now able to connect with multiple non-elevated instances to the db as long as non of them are started ia 'Run as administrator'.

 

It is not a question of "elevated" vs "non-elevated" users. Embedded
is *by design* a single-user model. A successful embedded connection
locks out all other users from connecting to the same database - hence
the error message you see. The *same user* can make multiple
connections from within the same application space.
So you mean that if I start one instance of my application normally and one instance of my application via 'Run as administrator' firebird

treats them as different users?

 

Arno

 

Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com]
Gesendet: Donnerstag, 27. Oktober 2016 22:33
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.

 

 

Embedded access to any database will only allow one connection.

 

Neville

 

Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com]
Gesendet: Donnerstag, 27. Oktober 2016 21:50
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.

 

 


> I am using Firebird embedded 3.0.1.

> I receive an EDatabase error : "[ODBC Firebird Driver]Database is
> probably already opened by another engine instance on another Windows session."

> when trying to connect to a firebird db simultaneously in
> Adminstrator (elevated) mode and non-elevated mode with the same user account.

It is not a question of "elevated" vs "non-elevated" users. Embedded
is *by design* a single-user model. A successful embedded connection
locks out all other users from connecting to the same database - hence
the error message you see. The *same user* can make multiple
connections from within the same application space.

> Does anyone know how to solve this issue?

It depends on the issue you are trying to solve. But if you want
multi-user access then you need to install a server. If you want
multiple embedded connections to connect concurrently, configure the
server as Classic or Superclassic. Note that the default server
installation is Superserver, which also cannot share with embedded
connections.

Describe what you want to achieve in real life and someone will advise
you about the best model for your requirements.

Incidentally, since you are using Delphi, be aware that embedded is a
deployment model, not a development one. You can't have an embedded
connection in the IDE space and another one in the executable space.
So you need to have a server running for your Delphi development, even
if you intend to deploy an embedded app for single-user use.

Helen






----------------------------------------------------
JAM Software GmbH
Geschäftsführer: Joachim Marder
Am Wissenschaftspark 26 * 54296 Trier * Germany
Tel: 0651-145 653 -0 * Fax: 0651-145 653 -29
Handelsregister Nr. HRB 4920 (AG Wittlich) http://www.jam-software.de