Heike Posted August 18, 2004 Posted August 18, 2004 This is, what I really want: I have a DELETE-Statement and then some INSERT-Statements. If one of the INSERT-Statements fails, a rollback should undo everything, so that my deleted data record stays there (isn't deleted). Everything I tried, didn't work. Therefore I tried the following: objTrans = OleDbConnection_SYSTEM.BeginTransaction() objDBCommand.Connection = OleDbConnection_SYSTEM objDBCommand.CommandText = "UPDATE ..." objDBCommand.Transaction = objTrans With objDBCommand 'Connection pruefen If objIBS_QueryShare.blnOpenConnection(.Connection()) Then objDBCommand.ExecuteNonQuery() End If End With objTrans.Rollback() But: despite of ROLLBACK I can see the changed data record. As database I use DB2 and I use an OLEDB driver. Any idea what maybe wrong? Thanks. Quote
Arch4ngel Posted August 18, 2004 Posted August 18, 2004 Is rollback supported by DB2 ???? Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Joe Mamma Posted August 19, 2004 Posted August 19, 2004 Is rollback supported by DB2 ????Something makes me think we ran into this problem. . . transactions arent supported in DB2 via ADO. you have to explicitly execute the SQL 'begin transaction' and then SQL to rollback or commit. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Arch4ngel Posted August 19, 2004 Posted August 19, 2004 That could be also a problem. DB2 is a old database system no ? How make this ? if it's not microsoft... don't expect to have it supported at 100%. :p Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Joe Mamma Posted August 19, 2004 Posted August 19, 2004 That could be also a problem. DB2 is a old database system no ? How make this ? if it's not microsoft... don't expect to have it supported at 100%. :pDB2 is the premier financials database. An IBM product. Used in Vanguard, Mass. Mutual and the New York Times pension systems, just to name a few clients of my previous employer. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Arch4ngel Posted August 19, 2004 Posted August 19, 2004 Well... seems too good to make Microsoft do less support on this one to push people to SQL-Server ! ALL AGAINST THE EVIL Microsoft© !!!!!! (sorry... too much coffee this morning) Well.. dude... you'll be forced to call a manual ROLLBACK Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.