Subject General approach question
Author Myles Wakeham
We have done most of our work with Firebird through PHP, which has been
brilliant. We have just completed a plug-in for a development language
called 4th Dimension (Windows version only) that provides a native 4D
Plug-in to connect to Firebird. This is not only important to us, because
we have a large amount of legacy 4D systems both in production and in
development, but also to the 4D community who are dealing with limited
connectivity options, particularly in the Open Source arena...

However, I digress... I'm writing a library of code that will allow
connectivity between an application in 4th Dimension and Firebird 1.5. In
doing this, I find that I have to develop a strategy for 'multi-processes'
in 4D, which would be similar to multiple threads in Borland's Delphi. In
4D, you can spawn a large number of processes that have their own memory
space and run concurrently. Each has its own variable set, although you can
also declare inter-process variables that can be read between all processes
on the system.

This brings up something I haven't had to deal with before with PHP. When I
make a connection to a Firebird database from one computer (consider it as a
single client workstation on a network), should I create one connection and
allow all processes on that workstation to share it, or is it ok to have
each process create its own individual connection to Firebird? Is there any
downside risk of doing the latter here, because that would be easier to
manage in 4th Dimension? However I understand that there has been a lot of
discussion about multi-threading lately, and that there are changes coming
around the corner with Vulcan in regards to this, but would this impact my
design approach here?

What have others, in other languages that support multi-processing or
multi-threaded applications, done in regards to getting a connection to
Firebird and executing transactions? Our software could execute a large
number of transactions and I'd far prefer to have them running
asynchronously to the Firebird server.

Any tips are greatly appreciated.

Regards,
Myles

===========================
Myles Wakeham
Director of Engineering
Tech Solutions Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440
Web: www.techsol.org