I am using DB2 8.1.11.1 on NT with ASP.NET 1.1
When application make connection to database (via ADO.NET), it set
"Connection timeout" parameter to 30 seconds.
After, when my webpage requests database, and query execution time
exceeds 30 seconds, the following error reported:
===
[57014] [IBM][DB2/NT] SQL0952N Processing was cancelled due to an
interrupt. SQLSTATE=57014
===
Ok, exception catched and current transaction rolled back.
From this point, the strange behavior begins:
Then application executes any update via this connection again and then
Commit, error occurs:
===
IBM.Data.DB2.DB2Exception: ERROR [2D522] [IBM][DB2/NT] SQL0774N The
statement cannot be executed within an ATOMIC compound SQL statement.
SQLSTATE=2D522
at IBM.Data.DB2.DB2Connection.b(IntPtr A_0, m A_1, x A_2)
at IBM.Data.DB2.DB2Transaction.Commit()
===
transaction also cannot be rolled back, similar error:
===
IBM.Data.DB2.DB2Exception: ERROR [2D522] [IBM][DB2/NT] SQL0774N The
statement cannot be executed within an ATOMIC compound SQL statement.
SQLSTATE=2D522
at IBM.Data.DB2.DB2Connection.b(IntPtr A_0, m A_1, x A_2)
at IBM.Data.DB2.DB2Transaction.Rollback()
===
but executed update locks table rows, and I need restart IIS
application pool to purge connections.
The only workaround I found is make new connection, perform update and
close both connections. Connections closed whithout errors.
But ADO.NET maintains connection pooling, and later, at another pages,
when I connecting database again, and new connection is a old "bad"
connection, it works for select data, but gave error at closing:
===
IBM.Data.DB2.DB2Exception: ERROR [HY010] [IBM] CLI0125E Function
sequence error SQLSTATE=HY010
at IBM.Data.DB2.d.a(Boolean A_0)
at IBM.Data.DB2.DB2ConnPool.a(d A_0, w A_1)
at IBM.Data.DB2.DB2ConnPool.a(Object A_0, Boolean A_1)
at IBM.Data.DB2.q.a(Boolean A_0)
at IBM.Data.DB2.DB2Connection.k()
at IBM.Data.DB2.DB2Connection.Close()
===
then connection became "good" (or killed by connection pool) but
strange behavior ends.
Any ideas?