Subject Re: [firebird-support] Deadlock with select-storedprocedure
Author Thomas Steinmaurer
Josef,

> once in a while we get a deadlock executing the statement "Select * from
> SP_SWAP_MD(Someparameters)".
> SP_Swap_MD is a stored procedure which only contains a select-statement
> joining 3 tables.
>
> Details:
> - The exception is: java.sql.SQLException: GDS Exception. 335544336.
> deadlock
> - All transactions do have the isolation-level READ_COMMITTED (Jaybird)
>
> Although, there might be an update performed to one of these tables at
> the time this stored proc is executed, we kind of thought there is no
> deadlock with select-queries. Is this wrong?
>
> If it is wrong, under which circumstances a deadlock can occure during a
> select-statement (read).

If you have started your transaction for the selectable stored procedure
with the NO_RECVERSION option, then it won't be able to read a record
which has been updated by a transaction yet uncommitted.

"Good" old MSSQL2000 style. ;-)


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com