Re: Multi Level Transaction (InnoDB)

2004-01-16 Thread Dan Nelson
In the last episode (Dec 31), Harta Teo said:
 Just wondor how InnoDB handle Multi Level Transaction, For example,
 
 BEGIN  
 DELETE FORM table1 WHERE id = 123
 BEGIN New Transaction Level 2
 DELETE FROM table1 WHERE id = 234
 COMMIT --- Level2
 ROLLBACK ---Level1

The manual ( http://www.mysql.com/doc/en/Implicit_commit.html ) says:

  The following commands implicitly end a transaction (as if you had
  done a COMMIT before executing the command): ... BEGIN ...

If you want multiple rollback levels, take a look at the SAVEPOINT
command:  http://www.mysql.com/doc/en/Savepoints.html

-- 
Dan Nelson
[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Multi Level Transaction (InnoDB)

2004-01-16 Thread Chris Nolan
Depending on your language, you might be able to fudge this up to work
for yourself. In C/C++ I have a function that automagically decides
whether I am beginning a new transaction when I am calling it or whether
I want Oracle-style nested transaction functionality. My rollback
function is aware of this also.

The only thing that you can't do with this approach that Oracle can do
with it's nested transaction functionality is (to my knowledge) alter
the isolation level at each SAVEPOINT. For reasons unknown to me, Oracle
allows this although I can not actually think of an application for it.

Regards,

Chris

On Fri, 2004-01-16 at 18:18, Dan Nelson wrote:
 In the last episode (Dec 31), Harta Teo said:
  Just wondor how InnoDB handle Multi Level Transaction, For example,
  
  BEGIN  
  DELETE FORM table1 WHERE id = 123
  BEGIN New Transaction Level 2
  DELETE FROM table1 WHERE id = 234
  COMMIT --- Level2
  ROLLBACK ---Level1
 
 The manual ( http://www.mysql.com/doc/en/Implicit_commit.html ) says:
 
   The following commands implicitly end a transaction (as if you had
   done a COMMIT before executing the command): ... BEGIN ...
 
 If you want multiple rollback levels, take a look at the SAVEPOINT
 command:  http://www.mysql.com/doc/en/Savepoints.html
 
 -- 
   Dan Nelson
   [EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Multi Level Transaction (InnoDB)

2004-01-15 Thread Harta Teo
Just wondor how InnoDB handle Multi Level Transaction, For example,

BEGIN  
DELETE FORM table1 WHERE id = 123
BEGIN New Transaction Level 2
DELETE FROM table1 WHERE id = 234
COMMIT --- Level2
ROLLBACK ---Level1

Thanks.