Informix transaction through ADO with stored procedures.
Posted in 1999
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET
Here is my problem: I have a stored procedure. The procedure is large and non-trivial to undo manually. The procedure is run through an ADO call. The returned recordset is localized into a collection. That collection is then processed with more insert/update queries, etc. My problem comes when I try to use transactions: As soon as I localize the returned values and then try to roll back I get error #25580, which is a catch-all "see administrator" type error that I found most unhelpful. Here is a skeleton of my code: Conn.Open <<DSN info.>> Conn.Execute "BEGIN WORK" <--has been substituted with Conn.BeginTrans RS = Conn.Execute "MyProcedure(MyArg1, MyArg2 . . )" For Each Row in RS MyArray(0) = rs(0) . . . MyArray(n) = rs(n) MyCollection.Add MyArray Next Row RS.Close Goto ErrHandler ErrHandler: Conn.Execute "ROLLBACK WORK" <--Has been substituted with Conn.RollbackTrans Conn.Close And that fails. When the connection transaction methods (Conn.BeginTrans, etc.) are used, I also get an error when I attempt to clost the connection saying that one should not close a connection with a transaction opened. Also, in order to rule out any attempts by the ODBC driver or ADO to do anything silly, I tried putting "Rollback Work" in its own stored procedure, to no avail: the same error was raised. I am working with ADO 2, Informix ODBC driver 2.8 (SDK 2.1), Informix v7.22 on a Sparc, VB6 Enterprise on a PC. Any help would be much appreciated. -Michael Hurwitz Information Concepts -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own