Subject Re: [firebird-support] What I am missing in the transaction ?
Author Dimitry Sibiryakov
24.09.2018 19:09, m_brahim11@... [firebird-support] wrote:
> I start a read transaction T1 where I check with a SELECT to see if  the record exists and
> commit the T1
> If the record doesn't exist the client show a message to the user and ignore the T2
> if record exists I start the second write transaction T2 to update the record just after
> the T1 in the same code and commit T2. I don't know if it is correct.

Generally it is incorrect. You'd better just to update the record in T2 and check
number of records affected. If it is zero - record didn't exist anymore.

--
WBR, SD.