|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
FB embedded and multihreading
Is it possible to use FB embedded on Win32 platform in a multithreaded application? Currently our server that relies on FB embedded keeps crashing in the FBCLIENT.DLL if the calls are made from different threads simultaneously. Serializing the requests hurts performance noticeably especially if there are any active update operations that take long time. Hence my questions:
Best regards Karel Obluk |
|
#2
|
|||
|
|||
|
Hi,
Firebird isn't thread safe if you let multiple threads use the same connection. With Fb Embedded, you can have only a single connection to a database, therefor: not threadsafe. -- Martijn Tonies Database Workbench: works with Firebird, MySQL, InterBase and MSSQL Server Upscene Productions http://www.upscene.com
__________________
Martijn Tonies Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle Upscene Productions http://www.upscene.com |
|
#3
|
|||
|
|||
|
OK, thanx for explanation.
Now, from your answer I assume that if using the standalone version, it should be possible to create multiple connections and use them from more than one thread. Is that so? Also, is it possible to pass the connection in between threads (i.e. re-using a connection)? In my app I have a huge number of short-live threads and I would like to use some kind of "connection pool". Is that possible? Thank you very much for your help! Karel |
|
#4
|
|||
|
|||
|
Hi,
I'm unsure if you can have multiple connections with Embedded to the same database. Give it a try, I would say, but I don't think so. Yes, you can pass connections between threads -- but only ONE thread should be using the connection at any time. Anyway, threads are easier with the full server and a remote connection. -- Martijn Tonies Database Workbench: works with Firebird, MySQL, InterBase and MSSQL Server Upscene Productions http://www.upscene.com |
|
#5
|
|||
|
|||
|
I understand that it is not possible to use multiple connections with the embedded version. What I was asking now was if multiple connections from multiple threads can be used with the standalone version (remote connection). If yes, this would solve my problem.
Thank you |
|
#6
|
|||
|
|||
|
Hi,
As I said, that's possible. But only 1 thread should use 1 connection at any time. And you have to use a "remote" connection (if it's on the same machine, use "localhost" as the server name). -- Martijn Tonies Database Workbench: works with Firebird, MySQL, InterBase and MSSQL Server Upscene Productions http://www.upscene.com |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > FB embedded and multihreading |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|