Subject | Bookmarks in transactions |
---|---|
Author | Gustavo |
Post date | 2005-08-29T18:22:19Z |
Hello:
My question is if there is something similar to a "bookmark" in transactions. I explain this with the following example.
Suppose I start a transaction, then I do some updates, then I "mark a bookmark", then I do some other updates. Finally I do a rollback. What I want is that this rollback affects only the updates done since the bookmark. In Delphi it will look like the following code:
Transaction1.StartTransaction;
Query1.SQL.Text:='UPDATE TABLE TABLE1 SET FIELD1 = 20 WHERE CODIGO = 1';
Query1.ExecQuery;
Transaction1.GetBookmark; {THIS IS THE INSTRUCTION I WANT TO KNOW IF IT EXISTS}
Query1.SQL.Text:='UPDATE TABLE TABLE1 SET FIELD2 = 50 WHERE CODIGO = 1';
Query1.ExecQuery;
Transaction1.RollBack;
{Now, Field2 should be the original value (before updating it to 50) but field1 shoud be 20 because the first update wasn't rollbacked}
AFAIK the instruction "Transaction1.GetBookmark;" doesn't exists, but perhaps someone knows another way of doing this.
My question is: Is there a way to do this?
Thanks in advance.
Gustavo
[Non-text portions of this message have been removed]
My question is if there is something similar to a "bookmark" in transactions. I explain this with the following example.
Suppose I start a transaction, then I do some updates, then I "mark a bookmark", then I do some other updates. Finally I do a rollback. What I want is that this rollback affects only the updates done since the bookmark. In Delphi it will look like the following code:
Transaction1.StartTransaction;
Query1.SQL.Text:='UPDATE TABLE TABLE1 SET FIELD1 = 20 WHERE CODIGO = 1';
Query1.ExecQuery;
Transaction1.GetBookmark; {THIS IS THE INSTRUCTION I WANT TO KNOW IF IT EXISTS}
Query1.SQL.Text:='UPDATE TABLE TABLE1 SET FIELD2 = 50 WHERE CODIGO = 1';
Query1.ExecQuery;
Transaction1.RollBack;
{Now, Field2 should be the original value (before updating it to 50) but field1 shoud be 20 because the first update wasn't rollbacked}
AFAIK the instruction "Transaction1.GetBookmark;" doesn't exists, but perhaps someone knows another way of doing this.
My question is: Is there a way to do this?
Thanks in advance.
Gustavo
[Non-text portions of this message have been removed]