Feature #160

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

Added by Madars Vitolins 5 months ago. Updated 5 months ago.

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

100%

Category:-
Target version:-

Description

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

NDRX_XA_FLAGS=RECON:*:3:100000;OTHERTAG:someotherdata;

The RECON tag would match the logic described above.

History

#1 Updated by Madars Vitolins 5 months ago

  • Priority changed from Normal to High

#2 Updated by Madars Vitolins 5 months ago

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

#3 Updated by Madars Vitolins 5 months ago

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

#4 Updated by Madars Vitolins 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF