Subject Re: [Firebird-Java] Dead lock issue
Author Roman Rokytskyy
> I am getting deadlock with the below trace
>
> org.firebirdsql.jdbc.FBSQLException: GDS Exception 335544336. deadlock
> update conflicts with concurrent update
>
> Anyone can provide some clues to resolve this?

You cannot resolve this without changing your application's logic.

It is normal behavior that under some conditions you get deadlock - for
example, two transactions update the same row. Since they both have read old
value from the row, made some computation and try to save the new value,
which, however, does not reflect changes from the concurrent transaction.
Database engine cannot allow such updates, since it would bring database
into logically incorrect state.

So, you have two options:

- based on the error code do some internal handling, for example, execute
the same transaction (not only the update) again;

- change your system's design so that either no deadlocks are possible or
they become very rare.

Roman