nested-transactions

SAVE TRANSACTION vs BEGIN TRANSACTION (SQL Server) how to nest transactions nicely

六月ゝ 毕业季﹏ 提交于 2019-12-02 18:21:50
I have a stored procedure that needs to set a save point so that it can, under certain circumstances, undo everything it did and return an error code to the caller, or accept/commit it and return success to the caller. But I need it to work whether the caller has already started a transaction or not. The doc is extremely confusing on this subject. Here is what I think will work, but I'm not certain of all the ramifications. The thing is - this Stored Procedure (SP) is called by others. So I don't know if they've started a transaction or not... Even if I require users to start a transaction to

Achieving NHibernate Nested Transactions Behavior

你说的曾经没有我的故事 提交于 2019-11-30 22:44:23
I'm trying to achieve some kind of nested transaction behavior using NHibernate's transaction control and FlushMode options, but things got a little bit confusing after too much reading, so any confirmation about the facts I list below will be very usefull. What I want is to open one big transaction that splits in little transactions. Imagine the following scenario: TX1 opens a TX and inserts a Person's record; TX2 opens a TX and updates this Person's name to P2; TX2 commits; TX3 opens a TX and updates this Person's name to P3; TX3 rollbacks; TX1 commits; I'd like to see NH sending the INSERT

Achieving NHibernate Nested Transactions Behavior

淺唱寂寞╮ 提交于 2019-11-30 17:20:40
问题 I'm trying to achieve some kind of nested transaction behavior using NHibernate's transaction control and FlushMode options, but things got a little bit confusing after too much reading, so any confirmation about the facts I list below will be very usefull. What I want is to open one big transaction that splits in little transactions. Imagine the following scenario: TX1 opens a TX and inserts a Person's record; TX2 opens a TX and updates this Person's name to P2; TX2 commits; TX3 opens a TX

Why nested transactions are not supported in JTA

喜你入骨 提交于 2019-11-30 13:03:07
Why aren't nested transactions supported by JTA? Is it because of the complexity of implementing them (which I doubt) or some design principle? Stephen C (As @Piotr Nowicki points out, JTA does allow nested transactions, but this is optional not mandatory.) Why? This is one of those questions that is impossible to answer with any certainty, unless you were one of the people "in the room" when the decisions were made. It could be the inherent complexity of including nested transactions as part of the spec. Or apparent complexity at the time; i.e. they weren't sure they knew how to do a good job

EJB 3.0 - Nested Transaction != Requires New?

ぐ巨炮叔叔 提交于 2019-11-27 11:35:40
I just read the Transactions Chapter (10) of "Mastering EJB 3.0" and now I'm confused about nested transactions. The book says "The EJB-defined transaction manager does not support nested transactions; it requires support for only flat transactions." (Site 278, Note) This fact is described not only by this book, I found this statement in other books / websites. But if I call a "Requires New" annotated Method from a, let's say "Required" annotated Methode, what I have is a nested transaction, isn't it? I can roll back the inner transaction or commit it, without affecting the outer transaction.

EJB 3.0 - Nested Transaction != Requires New?

瘦欲@ 提交于 2019-11-26 18:02:22
问题 I just read the Transactions Chapter (10) of "Mastering EJB 3.0" and now I'm confused about nested transactions. The book says "The EJB-defined transaction manager does not support nested transactions; it requires support for only flat transactions." (Site 278, Note) This fact is described not only by this book, I found this statement in other books / websites. But if I call a "Requires New" annotated Method from a, let's say "Required" annotated Methode, what I have is a nested transaction,

Are nested transactions allowed in MySQL?

别来无恙 提交于 2019-11-26 15:53:29
Does MySQL allow the use of nested transactions? 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 --- From MySQL documentation: Transactions cannot be nested. This is a consequence of the implicit commit performed for any current transaction when you issue a START TRANSACTION

Are nested transactions allowed in MySQL?

妖精的绣舞 提交于 2019-11-26 04:39:18
问题 Does MySQL allow the use of nested transactions? 回答1: 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 --- 回答2: From MySQL documentation: Transactions cannot be nested. This is a