Hi Stewert, all,
On Fri, Dec 4, 2009 at 12:42 AM, Stewart Smith <[email protected]> wrote:
> We should also think about savepoints (i.e. nested transactions)
heh, I always wondered what that means, nested transaction. I mean, I
think I understand savepoints (ability to rollback to a prior bookmark
set in the -single - transaction scope). When I hear nested, I am
thinking of units that exist as a unit inside their a container.
Now, if a transaction is demarcated by "begin" and terminated by
either rollback or commit, and you're talking about nesting these
things, I am thinking of doing something like:
begin
-- some changes here #1
begin
-- some changes here #2
commit
--- some changes here #3
commit
#1, #2 and #3 would be committed. All hunky dory. Now if we did:
begin
-- some changes here #1
begin
-- some changes here #2
rollback
--- some changes here #3
commit
then it's still feasible: #2 is rollead back, but #1 and #3 can still
be committed.
But what if we are to do this:
begin
-- some changes here #1
begin
-- some changes here #2
commit
--- some changes here #3
rollback
What would be the semantics of here?
You could argue that since the outer transaction was rolled back, all
must be rolled back. But that in my mind conflicts with #2 already
being committed. I mean, it's still a commit, right? Or are some
commits more equal than others?
You could also argue that #1 and #3 must be rolled back, and #2 must
be committed, but that can't make sense either, because maintaining
integrity while committing #2 may depend on ability to commit #1, so
this clearly can't be allowed.
My conclusion is that the term "nested transactions" doesn't make
sense, at least not when nesting is understood as having "transactions
inside transactions" while maintaining an absolute sense of "commit"
Of course, savepoints do make sense, but there it works because you
simply allow rollback to certain points within the transaction. But
the key here is I guess that in that case, you are always maintaining
exactly one transaction at all times, you just have the ability to set
"bookmarks" for rollback.
regards,
Roland.
>
> --
> Stewart Smith
>
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help : https://help.launchpad.net/ListHelp
>
--
Roland Bouman
http://rpbouman.blogspot.com/
Author of "Pentaho Solutions: Business Intelligence and Data
Warehousing with Pentaho and MySQL",
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470484322.html
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp