Feature #160

Add feature to XA subsystem so that if tpbegin fails, then do tpclose/tpopen/tpbegin aganin

Added by Madars Vitolins over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:06/19/2017
Priority:HighDue date:
Assignee:-% Done:


Target version:-


In setups where there is firewall between the application and database, the firewall might drop the connections after some period of inactivity. This tpbeigin() for process might fail.

The option would be here: http://www.silodev.com/lxr/source/libatmi/xa.c#0291
If xa_start() (begin/join transaction) fails, then call xa_close(), xa_open() and then again xa_start(), and return error only after second attempt. This would solve any connection issues. The setting could be new environment variable, format lets say "<list of error codes, or "*">:<retry count>:<sleep microseconds between attempts>". for example "RECON:*:3:100000;".

  1. attempt 1: xa_start() fails
  2. sleep 0.1 sec
  3. attempt 2: xa_close(), xa_open(), xa_start() fails
  4. sleep 0.1 sec
  5. attempt 3: xa_close(), xa_open(), xa_start() OK.. continue...

The generic flags env variable named "NDRX_XA_FLAGS" could be added. It could keep various settings, format could CSV separated, TAG1:<value1>,..., TAGN:<valueN>.

For this case


The RECON tag would match the logic described above.


#1 Updated by Madars Vitolins over 1 year ago

  • Priority changed from Normal to High

#2 Updated by Madars Vitolins over 1 year ago

changes shall go to 3.8.x and 4.0.x versions.

#3 Updated by Madars Vitolins over 1 year ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Madars Vitolins over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF