Simple doubt, the title says it all. =)
+2
A:
InnoDB
supports SAVEPOINTS
.
You can do the following:
CREATE TABLE t_test (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
START TRANSACTION;
INSERT
INTO t_test
VALUES (1);
SELECT *
FROM t_test;
id
---
1
SAVEPOINT tran2;
INSERT
INTO t_test
VALUES (2);
SELECT *
FROM t_test;
id
---
1
2
ROLLBACK TO tran2;
SELECT *
FROM t_test;
id
---
1
ROLLBACK;
SELECT *
FROM t_test;
id
---
Quassnoi
2009-08-20 15:16:12
Thanks, I'll keep this in mind for future reference.
Alix Axel
2009-08-20 15:27:20
A:
Have you tried it? It should only take you a few seconds, and then you would have your answer.
Marius
2009-08-20 15:16:17
The problem with "try it" approaches is it might appear to work in some scenarios and not others. I wouldn't base an important and complex concept such as transactions with a "let's see what happens" approach.
nos
2009-08-20 15:19:58
@Marius, No I haven't. The box where I'm at doesn't have a MySQL installed.
Alix Axel
2009-08-20 15:29:20
+1
A:
Actually they started to do:
Nested transaction scopes were not supported. MySQL Connector/NET 6.3.xx now implements nested transaction scopes. A per-thread stack of scopes is maintained, which is necessary in order to handle nested scopes with the RequiresNew or Suppress options.
http://dev.mysql.com/doc/refman/5.5/en/connector-net-news-6-3-0.html
jalchr
2010-03-23 18:06:17