So I'm going in and adding TAF (cluster failover) processing to some database code, and I'm winding up with similar chunks of code that look like this:
try:
... some database code...
except cx_Oracle.DatabaseError,e:
# ORA-25401: can not continue fetches
# ORA-25402: transaction must roll back
# ORA-25408: can not safely replay call
if e.message.code in (25401,25402,25408):
print 'node going down, restarting transaction...'
conn.rollback()
continue
else:
raise(e)
- Are there any places where I can grab some symbolic names for these codes?
- Are there any sources of logical return code groupings? i.e. these are the ones related to transaction failure due to a node going down, and if retried will be redirected to another node and executed successfuly.
update: it turns out the answers are No and No.