FirebirdSQL / firebird

Firebird server, client and tools
https://firebirdsql.org
1.26k stars 218 forks source link

Embedded connection active during 60sec after database close [CORE6096] #6345

Open firebird-automations opened 5 years ago

firebird-automations commented 5 years ago

Submitted by: Sławomir Zalewski (slawek)

1. My application works with Firebird embedded. 2. I close connection - IBDatabase1.Connected := False; 3. I make backup of the database and close that connection. 4. I open database. 5. After 60 sec, if I try to do anything with database, I receive message "Connection shutdown".

If I wait 60 sec after steps 2 and 3, everything works fine.

I checked version 4.0 Beta 1 - it works OK without waiting.

firebird-automations commented 5 years ago
Modified by: Sławomir Zalewski (slawek) environment: Windows 10, Delphi application, Firebird3 embedded =\> Windows 10, Delphi application, Firebird3 embedded, ICU57 library
firebird-automations commented 5 years ago

Commented by: @hvlad

Is it reproducible with isql ?

firebird-automations commented 5 years ago

Commented by: Sławomir Zalewski (slawek)

- I didn't try, but I've checked that: 1. ICU library is not important 2. problem with FB v.3 (the problem doesn't occur for 4.0 Beta 1) is only after using TIBBackupService control for backup the database 3. I can use gbak instead, but have to close the database to make backup. This is not convenient way to perform temporary backups.

firebird-automations commented 5 years ago

Commented by: @hvlad

1. Sure :) 2. Sounds strange. Does TIBBackupService unload fbclient.dll ? 3. Read FB3 Release Notes about new architecture and how to change ServerMode from Super to [Super]Classic

firebird-automations commented 5 years ago

Commented by: Sławomir Zalewski (slawek)

I use Windows embedded local server - copy of fbclient.dll as gds32.dll. Im affraid that 3.x version of fbclient.dll could be unloaded after 60 sec.

firebird-automations commented 5 years ago

Commented by: @hvlad

Reproducible test case needed

firebird-automations commented 5 years ago

Commented by: Sławomir Zalewski (slawek)

Excuse me if this form is not correct. I' ve created SourceForge account with files to be downloaded: https://sourceforge.net/projects/firebirdcore-6096/files/

There are: - Delphi2010 simple application source code. Application name is EmbeddedBackup - compiled EmbeddedBackup.exe with simple test database (v.3) and Firebird Embedded 3 files - compiled EmbeddedBackup.exe with simple test database (v.4) and Firebird Embedded 4 files and - screen with error message - Firebird Embedded 3 - screen without errors - Firebird Embedded 4

* test database (v.4) I created from backuped test database (v.3)

firebird-automations commented 5 years ago

Commented by: @hvlad

The problem is that application loads gds32.dll but all other components (engine12.dll, etc) uses fbclient.dll. Therefore two instances of Dispatcher is created and they are not coordinated with each other.

Application must use fbclient.dll to make embedded engine works properly.

firebird-automations commented 5 years ago

Commented by: Sławomir Zalewski (slawek)

But why that problem has disappeared from Firebird 4? For Delphi and IBX library it is a serious problem. I've found solution: https://www.mwasoftware.co.uk/15-blog/84-using-firebird-with-delphi-2005-and-later but haven't tested it yet.