Subject RE: [firebird-support] Deadlock because of limbo transaction
Author Alan McDonald
> I have two databases, one server database and one client database on a
> laptop. Every day data is imported from the server to the client
> database. My app works like this:
>
> 1) Connect to the server and client database within one transaction
> (using the 2PC protocol)
> 2) Look in table SYNC_TASKS if there is synchronization task for me
> 3) If a task is found, log the start of the synchronization task
> 4) Synchronize the data
> 5) Log the end of the synchronization task
> 6) commit transaction
> 7) disconnect from both databases
>
> Now at point 5) the network connection has been interrupted and
> therefore the transaction is left in limbo state. So far all is
> clear to me.
> Now when I start my app, I get at point 2) the following error
> Error: ISC ERROR CODE:335544459
> ISC ERROR MESSAGE:
> record from transaction 59681 is stuck in limbo
>
> I don't understand, why a select on table SYNC_TASKS causes a deadlock.
> I thought, because of the multi generation architecture of FB it is
> impossible to create a deadlock, when reading data.
> Perhaps someone can tell me where my error in reasoning is.
>
> Regards
>
> Guido

you might be confusing a limbo transacion with a deadlock. You aren't
getting a deadlock here - otherwise your error message would be something
about a deadlock. You have a limbo transaction, and this only occurs with a
badly interrupted 2-phase commit. Is that what you are using? a 2-phase
commit? (you don't mention any detail).
Are you testing this setup by pulling the plug during the sync? In my
experience, you have to be very very unlucky to get limbo transactions... I
use 2 phase commit with FBReplicator and have never had this issue. (in
about 48 server years).
Alan