Subject Re: Unsuccessful execution error
Author Adam
> I'm really new to Firebird (and pretty new to SQL development
> altogether). I'm having some problems with an app that I hope
someone can
> help with.
> I've got an app that is currently using superserver mode to talk to a
> Firebird database. The database is installed on the same PC the app
runs from.
> The app potentially adds several thousand records at once, and does it
> using threads. Each thread creates a new Query object to perform any
> queries or updates.
> Once the app is completed, It's extremely likely it will be released
> the embedded server. As a result, all the threads and queries are
using the
> same database connection (unless I'm wrong, I can only have one
> with the embedded server?)

No you can not do this because the connection is NOT threadsafe.

An embedded server is able to support multiple connections providing
they are initiated by a single process. Each thread must have its own
connection object. Not sure about whether they can share a transaction
or not, but I doubt it.

This probably explains your AV below.


> The problem I'm having seems to be occurring if a thread is actively
> records and I try and refresh the view in the app (main thread,
> a select), I get either an access violation or
> the following SQL exception:
> Error Code: -901. "Unsuccessful execution caused by system error
that does
> not preclude successful execution of subsequent statements."
> I'm a bit confused. Should I be creating a new connection for each
> query? Won't that stop me using the embedded server? Apologies if
this is
> documented somewhere, I've read somewhere in the region of 800 pages of
> Firebird and Interbase documentation today and I've mildly fried my
> Developing using Firebird 1.5 and Delphi 7 with Zeoslib 6.5.1 in
case that
> helps explain anything.
> Cheers,
> Rik