Subject Re: [firebird-support] Unsuccessful execution error
Author Rik Barker

Thanks to everyone who replied. Giving each thread its own connection
fixed the problem perfectly.

>Yes. I'm not sure if anyone's actually documented this behaviour (i.e.
>embedded permitting multiple connections from separate threads of a single
>application) but it's certainly the way it works in practice, as I've been
>finding out recently. Although one has to be slightly careful about using
>COMMIT to "synchronize" the view of the database between the threads, it
>can be seriously useful for each thread to have a distinct "isolated" view
>of the database.

Could you expand on the need to be careful? Are you talking about cases
like potential issues if 2 threads have both altered the same record?

I don't think that will impact my current design, as I've got threads doing
inserts, with selects first to avoid duplicates. It would be highly
unlikely (though not impossible admittedly) that 2 or more threads both try
and insert the same record at the same time.