Discussion:
[firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.
Arno Peter peter@jam-software.com [firebird-support]
2016-10-27 09:35:37 UTC
Permalink
Hello All,


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.


Does anyone know how to solve this issue?


Thanks for your help.


Best regards
A. Peter


________________________________






--------------------------------------------------------
JAM Software GmbH
Managing Director: Joachim Marder
Am Wissenschaftspark 26 * 54296 Trier * Germany
Phone: +49 (0)651-145 653 -0 * Fax: +49 (0)651-145 653 -29
Commercial register number HRB 4920 (AG Wittlich) http://www.jam-software.com



________________________________






----------------------------------------------------
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
Helen Borrie helebor@iinet.net.au [firebird-support]
2016-10-27 19:49:50 UTC
Permalink
Post by Arno Peter ***@jam-software.com [firebird-support]
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.
Post by Arno Peter ***@jam-software.com [firebird-support]
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
Arno Peter peter@jam-software.com [firebird-support]
2016-10-28 07:24:16 UTC
Permalink
Thanks for your answers.
Post by Helen Borrie ***@iinet.net.au [firebird-support]
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-***@yahoogroups.com [mailto:firebird-***@yahoogroups.com]
Gesendet: Donnerstag, 27. Oktober 2016 22:33
An: firebird-***@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-***@yahoogroups.com [mailto:firebird-***@yahoogroups.com]
Gesendet: Donnerstag, 27. Oktober 2016 21:50
An: firebird-***@yahoogroups.com
Betreff: Re: [firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.
Post by Helen Borrie ***@iinet.net.au [firebird-support]
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.
Post by Helen Borrie ***@iinet.net.au [firebird-support]
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
Dimitry Sibiryakov sd@ibphoenix.com [firebird-support]
2016-10-28 08:50:02 UTC
Permalink
Post by Arno Peter ***@jam-software.com [firebird-support]
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
Try to make your service (which is obviously run from LOCAL SYSTEM account) to switch
into non-elevated mode before connecting to database. If it fail, run the service from
ordinary user account.
--
WBR, SD.


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-***@yahoogroups.com
firebird-support-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-***@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
emilt@tot-consult.com [firebird-support]
2016-10-28 09:54:26 UTC
Permalink
Post by Arno Peter ***@jam-software.com [firebird-support]
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.
Post by Arno Peter ***@jam-software.com [firebird-support]
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




Actually this is only true for superserver embedded mode, prior to 2.5.
In 2.5 embedded mode on windows is superclassic, and multiple connections from multiple applications using the same embedded library are normally possible.
There is some issue however that does not allow this from some context, e.g. from a normal application and from a script, executed by the web server. I don't remember now the exact details, but it was not a question of user account - even when the web server was using the same user account, it didn't work. I believe there is at least one discussion somewhere in the list history about this issue.


Emil
Arno Peter peter@jam-software.com [firebird-support]
2016-10-31 13:04:55 UTC
Permalink
The *same user* can make multiple
connections from within the same application space.
Are you sure? Because I am able to connect to the same db using the same embedded library from different instances of my application using the same user account but only if all of the instances are elevated or all instances are not elevated.
"Mixed mode" seems not to work even if I use the same user account.

Actually this is only true for superserver embedded mode, prior to 2.5.
In 2.5 embedded mode on windows is superclassic, and multiple connections from multiple applications using the same embedded library are normally possible.
Yes, thats what I am trying.
As said before, I can start multiple applications (my exe file multiple times) and connect to the same db using the same embedded library.
So embedded version works for multiple applications on the same db but only if all applications are elevated or not (using the same user account).
Unfortunately my service has to run as elevated process.

There is some issue however that does not allow this from some context, e.g. from a normal application and from a script, executed by the web server.
Yes, maybe this is a similar issue.

If there is no other solution I would also install the firebird server but this would be the worst of all options.


Von: firebird-***@yahoogroups.com [mailto:firebird-***@yahoogroups.com]
Gesendet: Freitag, 28. Oktober 2016 11:54
An: firebird-***@yahoogroups.com
Betreff: Re: [firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.
Post by Arno Peter ***@jam-software.com [firebird-support]
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.
Post by Arno Peter ***@jam-software.com [firebird-support]
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


Actually this is only true for superserver embedded mode, prior to 2.5.
In 2.5 embedded mode on windows is superclassic, and multiple connections from multiple applications using the same embedded library are normally possible.
There is some issue however that does not allow this from some context, e.g. from a normal application and from a script, executed by the web server. I don't remember now the exact details, but it was not a question of user account - even when the web server was using the same user account, it didn't work. I believe there is at least one discussion somewhere in the list history about this issue.

Emil




________________________________



----------------------------------------------------
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
'Neville Richards' neville@meltonisl.com [firebird-support]
2016-10-27 20:33:01 UTC
Permalink
Embedded access to any database will only allow one connection.


Neville


From: mailto:firebird-***@yahoogroups.com
Sent: Thursday, October 27, 2016 10:35 AM
To: firebird-***@yahoogroups.com
Subject: [firebird-support] [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.





Hello All,




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.




Does anyone know how to solve this issue?




Thanks for your help.




Best regards


A. Peter






--------------------------------------------------------------------------------






--------------------------------------------------------
JAM Software GmbH
Managing Director: Joachim Marder
Am Wissenschaftspark 26 * 54296 Trier * Germany
Phone: +49 (0)651-145 653 -0 * Fax: +49 (0)651-145 653 -29
Commercial register number HRB 4920 (AG Wittlich) http://www.jam-software.com




--------------------------------------------------------------------------------






----------------------------------------------------
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
hvlad@users.sourceforge.net [firebird-support]
2016-10-31 18:05:40 UTC
Permalink
Arno Peter,

please read "Kernel object namespaces" article

https://msdn.microsoft.com/en-us/library/aa382954.aspx https://msdn.microsoft.com/en-us/library/aa382954.aspx

and note that Firebird uses kernel objects intensively

Regards,
Vlad
Arno Peter peter@jam-software.com [firebird-support]
2016-11-04 09:03:45 UTC
Permalink
Thank you. Your answers helped me a lot.
Seems that the embedded mode still has some issues with the same user on multiple instances
caused by the usage of Kernel object namespaces I guess.
I think i will switch to a "real" firebird server to solve my issues.


Von: firebird-***@yahoogroups.com [mailto:firebird-***@yahoogroups.com]
Gesendet: Montag, 31. Oktober 2016 19:06
An: firebird-***@yahoogroups.com
Betreff: [firebird-support] Re: [EDatabaseError] How to simultaneously connect to a firebird database in elevated and non-elevated mode.



Arno Peter,

please read "Kernel object namespaces" article

https://msdn.microsoft.com/en-us/library/aa382954.aspx

and note that Firebird uses kernel objects intensively

Regards,
Vlad


________________________________



--------------------------------------------------------
JAM Software GmbH
Managing Director: Joachim Marder
Am Wissenschaftspark 26 * 54296 Trier * Germany
Phone: +49 (0)651-145 653 -0 * Fax: +49 (0)651-145 653 -29
Commercial register number HRB 4920 (AG Wittlich) http://www.jam-software.com

________________________________



----------------------------------------------------
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
Loading...