Subject Re: [firebird-support] Re: Deadlocks without transaction
Author Ann W. Harrison
clarion55sucks wrote:
> I understand what your saying but the important point is that I do
> commit the changes (i would assume that if i didnt a new thread would
> not see the data and it is running in read commited mode),

> and I dont
> get errors on the new thread as you said I should but the old thread.

It depends less on the age of the thread than on the time when each
thread tried to physically modify the record. If the some layer in the
application is doing you the "favor" of caching updates, you'll have a
hard time guessing which thread actually sent the update to the database

> I am suspicious that the error message coming from the backend is
> confusing and the problem is really that there is a snapshot on the
> backend

I agree that thread A - the "oldest" thread - is probably snapshot mode.

> and If i could get A to see the most recent data instead of
> its snapshot than the problem might go away.

There's no way to force a transaction that's trying to give you
consistent results to read and return inconsistent (i.e. modified) data.

> Is there any way to turn off snapshots on the backend?

No. You may be able to convince the various levels involved to give you
read-committed transactions for your "non-transactional" reads. The
alternative is to start a new transaction for updates - and rollback and
restart after errors. Unlikely as it may seem to you at the moment,
providing a consistent view of data is a good thing - even if it means
that an error stays an error until you restart the transaction.