Subject | Re: [firebird-support] Rules on embedded server? |
---|---|
Author | Milan Babuskov |
Post date | 2007-07-19T20:54:22Z |
Helen Borrie wrote:
lock manager (running under my Linux account instead of firebird or
root). I guess it's just a side-effect?
by the same Linux user would work?
I just tried it with 2 instances of FlameRobin running in parallel and
it does work. I checked and I have only one lock manager running (under
my 'milanb' account):
milanb@asus:~$ ps aux | grep fb_lock
milanb 1847 0.0 0.2 3344 1068 ? S 22:49 0:00
/home/milanb/devel/fb-2.0.1-fr/bin/fb_lock_mgr
However, there are 2 FlameRobin processes holding the database file open:
milanb@asus:~$ lsof | grep DB
flamerobi 1837 milanb 6u REG 3,8 6225920 478557
/home/milanb/devel/fb-2.0.1-fr/baze/DB.FDB
flamerobi 1845 milanb 6u REG 3,8 6225920 478557
/home/milanb/devel/fb-2.0.1-fr/baze/DB.FDB
The situation looks exactly the same when I run regular Classic via xinetd.
http://sotu.berlios.de/Firebird-Embedded-Linux-HOWTO.html
On Linux nothing eforces the lock. In theory, well behaving programs are
required to check whether the lock is there. Unfortunatelly, very small
number of programs really check that. There are ways to mount your
filesystem in such way that locks are enforced (i.e. the program must
acuqire the lock before it can open the file) but it is not recommended
as defunct programs could leave locks open, hog the server and even
prevent graceful shutdown/reboot.
To make the story short: on standard Linux install, you can delete the
database file while there is a user connected to it, and some process
even having a lock on it. So, make sure you give root account and
'firebird' group access only to those who understand the Linux.
--
Milan Babuskov
http://fbexport.sourceforge.net
> Windows Yes. With libfbembed.so on Linux and a direct connection toThis makes me wonder. I use fbembedd.so on Linux and it still spawns the
> the database file ("embedded"), No. (Hint: you can use
> libfbclient.so with Classic for multi-threaded client apps...but it's
> not embedded, of course.)
lock manager (running under my Linux account instead of firebird or
root). I guess it's just a side-effect?
>>2. Can external programs also make a connection to the database while inGiven that lock-manager IS running, perhaps another application started
>>use by the application? Same with Windows and Linux?
>
> No.
by the same Linux user would work?
I just tried it with 2 instances of FlameRobin running in parallel and
it does work. I checked and I have only one lock manager running (under
my 'milanb' account):
milanb@asus:~$ ps aux | grep fb_lock
milanb 1847 0.0 0.2 3344 1068 ? S 22:49 0:00
/home/milanb/devel/fb-2.0.1-fr/bin/fb_lock_mgr
However, there are 2 FlameRobin processes holding the database file open:
milanb@asus:~$ lsof | grep DB
flamerobi 1837 milanb 6u REG 3,8 6225920 478557
/home/milanb/devel/fb-2.0.1-fr/baze/DB.FDB
flamerobi 1845 milanb 6u REG 3,8 6225920 478557
/home/milanb/devel/fb-2.0.1-fr/baze/DB.FDB
The situation looks exactly the same when I run regular Classic via xinetd.
>>3. What files need to be included when installing Firebird embedded withHere's a detailed explanation for FB1.5, FB2.0 needs ICU files as well:
>>Linux and Windows?
>
> For Linux, it is just a normal Classic install.
http://sotu.berlios.de/Firebird-Embedded-Linux-HOWTO.html
> On Linux you have the exclusive read/writePlease note that actually it does not prevent anything.
> lock that prevents anything else from getting access to the file
> whilst the embedded application has it.
On Linux nothing eforces the lock. In theory, well behaving programs are
required to check whether the lock is there. Unfortunatelly, very small
number of programs really check that. There are ways to mount your
filesystem in such way that locks are enforced (i.e. the program must
acuqire the lock before it can open the file) but it is not recommended
as defunct programs could leave locks open, hog the server and even
prevent graceful shutdown/reboot.
To make the story short: on standard Linux install, you can delete the
database file while there is a user connected to it, and some process
even having a lock on it. So, make sure you give root account and
'firebird' group access only to those who understand the Linux.
--
Milan Babuskov
http://fbexport.sourceforge.net