avoiding limbo transactions

13 views
Skip to first unread message

Nick Upson

unread,
Feb 11, 2021, 8:57:56 AMFeb 11
to firebird...@googlegroups.com
Hi

is there some way to configure firebird 2.5 to automatically avoid a limbo transaction & rollback the failed 2-phase commit

--
Nick

Jason (PN)

unread,
Feb 11, 2021, 9:35:22 AMFeb 11
to firebird...@googlegroups.com

Hi Nick,

 

I may have missed some e-mails on this, did you get to the bottom of why it was happening?  I would hate to just make them rollback if you don’t know why, kind of like turning off the smoke alarm as it keeps chirping.

 

Jason Chapman

JAC2 Consultancy Limited

Mob: 07966211959

--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/CAJa8MdnGN%3DvbogMSgx4seS5ReF4GTXczC%3DW-h_5x8NWxvLy5nw%40mail.gmail.com.

Nick Upson

unread,
Feb 11, 2021, 10:39:01 AMFeb 11
to firebird...@googlegroups.com
Hi Jason

the network has occasional glitches, I've long suspected it happens when firewalls/switches are reconfigured (its a very large customer network)
The software (Java) uses the bitronix library to do 2-phase commit across firebird & postgres databases (all on separate systems)
--
Nick


Mark Rotteveel

unread,
Feb 11, 2021, 11:17:09 AMFeb 11
to firebird...@googlegroups.com
On 11-02-2021 14:57, Nick Upson wrote:
> is there some way to configure firebird 2.5 to automatically avoid a
> limbo transaction & rollback the failed 2-phase commit
Firebird cannot make this decision for you. Limbo is the state of
2-phase commits that are prepared, but not yet committed or rolled back.
If it would automatically roll back for you, it would be the equivalent
of always rolling back.

When a transaction manager prepares a transaction, but something fails
during the commit or rollback, it can attempt to recover the transaction
and then rollback (or sometimes commit). It looks like your application
never attempts recovery.

Given you use Bitronix, you need to check if its transaction recovery is
used and configured correctly. To be clear: I have no experience with
Bitronix.

Mark
--
Mark Rotteveel

Nick Upson

unread,
Feb 11, 2021, 11:37:52 AMFeb 11
to firebird...@googlegroups.com
Hi Mark

the connection to the database drops, so the application cannot access the limbo transaction to commit or rollback

--
Nick


--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.

Dimitry Sibiryakov

unread,
Feb 11, 2021, 11:49:24 AMFeb 11
to firebird...@googlegroups.com
11.02.2021 17:37, Nick Upson wrote:
> the connection to the database drops, so the application cannot access the limbo
> transaction to commit or rollback

But you can schedule gfix execution to cleanup the limbo transactions on your server.

--
WBR, SD.

Mark Rotteveel

unread,
Feb 11, 2021, 11:52:02 AMFeb 11
to firebird...@googlegroups.com
On 11-02-2021 17:37, Nick Upson wrote:
> the connection to the database drops, so the application cannot access
> the limbo transaction to commit or rollback

It should be able to recover with a new connection. That is, a new
connection can scan for prepared transactions, reconnect a prepared
transaction and then commit or rollback the connection.

If Bitronix uses the Jaybird XADataSource implementation, that should work.

Mark
--
Mark Rotteveel

Nick Upson

unread,
Feb 11, 2021, 12:57:42 PMFeb 11
to firebird...@googlegroups.com
Mark

that would be great, can you point me in the right direction of more details, so I can pass them on

--
Nick


--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.

Mark Rotteveel

unread,
Feb 11, 2021, 1:35:43 PMFeb 11
to firebird...@googlegroups.com
On 11-02-2021 18:57, Nick Upson wrote:
> that would be great, can you point me in the right direction of more
> details, so I can pass them on

As I said, I have no experience with Bitronix, but Firebird's XA
implementation exposes the standard XAResource[1], which has a recover
method that a transaction manager can use to find prepared, but not
completed, transactions, it can then rollback or commit the transaction(s).

Looking at the Bitronix code, it should automatically recover on
startup, and every x seconds, where x depends on the configuration.

It should be possible to call it manually with
TransactionManagerServices.getRecoverer().run()

If org.firebirdsql.ds.FBXADataSource is used, and this doesn't work for
you, then maybe Jaybird is doing something wrong, but then I would love
to have runnable example that reproduces the problem.

[1]:
https://docs.oracle.com/en/java/javase/11/docs/api/java.transaction.xa/javax/transaction/xa/XAResource.html

--
Mark Rotteveel

Nick Upson

unread,
Feb 11, 2021, 2:57:58 PMFeb 11
to firebird...@googlegroups.com
thank you , very helpful
--
Nick


--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages