|Subject||Re: Transaction and concurrent updates|
> I have problem using transaction with JayBird for 1.5-beta-3-jdk14.In Firebird select statement does not obtain write lock on the row
> FireBird version is 1.5 for Windows. There are two connections in
> the example, where one perfroms a select and then an update. The
> second one updates the table between the select and update of the
> first connection. I think such a code should cause deadlock
> exception, but it succeeds. Please can you help me?
unless explicitly stated (SELECT ... FROM ... FOR UPDATE WITH LOCK).
In your example you have one transaction (connection 2) doing update
and then commit, and then another one (connection 1) doing update and
commit. There's no conflict, therefore no deadlock is reported.
Also note, that by default isc_tpb_wait mode is used, this means that
deadlock will be reported after quite long timeout (if I'm not wrong,
after 10 min.). If you wish to be notified about deadlock immediately,
you have to change TPB mapping to isc_tpb_nowait.