Not sure what happened to my previous post, if it reappears I'll remove one of them. When doing two consecutive connections against an HADR primary, the second one hangs for a couple of minutes before it bails out with an error:
SQL1776N The command cannot be issued on an HADR database. Reason code = "1". SQLCODE=-1776
Howto reproduce:
]$ python
Python 2.7.5 (default, May 3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ibm_db
>>> import ibm_db_dbi
>>>
>>> cfg = (db, user, pwd)
>>> ibm_db_conn = ibm_db.connect("DATABASE=%s;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=%s; PWD=%s" % cfg, "", "")
>>> conn = ibm_db_dbi.Connection(ibm_db_conn)
>>> conn.tables('SYSCAT', '%')
[{'TABLE_CAT': None, 'TABLE_TYPE': u'VIEW', ...
>>> ibm_db_conn2 = ibm_db.connect("DATABASE=%s;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=%s; PWD=%s" % cfg, "", "")
Hangs for a couple of minutes, before exit
I tried closing the first connection before initializing the second one, but that does not help. Running the same test on a stand-alone DB works.
I straced a script, and it appears as if it really tries to connect to the IP-number for the HADR-standby on the second attempt.
Anyone got a clue on what is going on?
Regards
/Lennart