Learnings

Tuesday, November 09, 2010

Automatic Client Reroute test results

ACR works with HADR and Replication. Very simple to setup, the Alternate Server parameters have to be setup during the Catalog Database step. The feature works transparently with minimal changes required to the application.
Some points observed:
1. If ACR is setup, then a connect from CLP goes silently to the right database without warning or error in case primary is down.
2. Normal jdbc program (using regular drivers and such) will report an error when primary goes down but if ACR is setup, they will automatically re-establish connection (no need for java program to reconnect) and continue.
When connection is re-established automatically, the following exception is thrown:
1288696202906: EXCEPTION:[jcc][t4][2027][11212][3.61.36] A connection failed but has been re-established. The host name or IP address is "ls129.in.ibm.com" and the service name or port number is 50,000.
Special registers may or may not be re-attempted (Reason code = 1). ERRORCODE=-4498, SQLSTATE=08506

It has to be caught and basically ignored in the catch block and the application has to re-attempt the transaction just as if it had failed due to a lock timeout, for example.
3. When connection is re-established, the same connection object, statement objects, etc continue to work (no need to reconnect or re-prepare statements).
4. In a HADR setup, if you try to connect to the standby instead of to the primary, then the following exception is raised:
Exception in thread "main" com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-1776, SQLSTATE= , SQLERRMC=1, DRIVER=3.61.36
5. ACR will return the alternate connection details only on successful connection to the main database as such. If the main connection itself fails to go through, there is no question on getting info about the alternate server.
6. Enhancement in 9.5 FP1 for seamless failover - 4498 is suppressed and failing statement is automatically retried if it is the first one in UOW. Use of seamless failover probably needs a slightly different way of using the db driver (some javax.* classes to be used)

Labels:

1 Comments:

  • I'm getting com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-1776, SQLSTATE= , SQLERRMC=1, DRIVER=3.57.82, how to solve this. Your post has thi discusion but no reolution, please help.

    By Blogger Unknown, at 4:42 AM  

Post a Comment

<< Home