Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
Is rollback supported by DB2 ????

"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

Posted
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.

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.

Posted
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

"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

Posted
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
DB2 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.

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.

Posted

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

"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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...