Questions tagged [nested-transactions]

43 questions
110
votes
2 answers

Are nested transactions allowed in MySQL?

Does MySQL allow the use of nested transactions?
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
29
votes
2 answers

EJB 3.0 - Nested Transaction != Requires New?

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…
NorRen
  • 711
  • 2
  • 9
  • 22
23
votes
2 answers

Purpose of nested transactions

I have never understood what a nested transaction is good for. Committing a nested transaction commits nothing - it just decreases @@TRANCOUNT. And ROLLBACK rollbacks everything. BEGIN TRANSACTION //do an update BEGIN TRANSACTION //do an…
Petar Minchev
  • 46,889
  • 11
  • 103
  • 119
20
votes
3 answers

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

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…
Brian B
  • 1,509
  • 3
  • 20
  • 29
12
votes
3 answers

SQL Server 2005: Why Name Transactions?

I've been sorting out the whole nested transaction thing in SQL server, and I've gleamed these nuggets of understanding of behavior of nested trans': When nesting transactions, only the outermost commit will actually commit. "Commit Trans…
user144133
  • 435
  • 1
  • 4
  • 9
11
votes
3 answers

Why nested transactions are not supported in JTA

Why aren't nested transactions supported by JTA? Is it because of the complexity of implementing them (which I doubt) or some design principle?
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
10
votes
2 answers

Check if an existing transactionscope is active

I am using: public class TransactionUtils { public static TransactionScope CreateTransactionScope() { var TransactionOptions = new TransactionOptions(); TransactionOptions.IsolationLevel =…
webnoob
  • 15,747
  • 13
  • 83
  • 165
7
votes
1 answer

Spring nested transaction rollback after handling exception

I have a @Service class which has a @Transactional method that calls another @Transactional method on the another service. Something like that: @Service public class AService { @Autowired BService b; @Autowired ARepository aRepo; …
7
votes
3 answers

How do I enable nested transactions with ADO.NET and SQL Server?

I have similar question to how to check if you are in a transaction. Instead of checking, how do I allow nested transactions? I am using Microsoft SQL Server Database with ADO.NET. I have seen examples using T-SQL and examples starting transactions…
user34537
6
votes
2 answers

Real-world uses of MySQL savepoints in web services?

Does anyone have experience they can share using MySQL savepoints (directly or via an ORM), especially in a non-trivial web service? Where have you actually used them? Are they reliable enough (assuming you're willing to run a fairly recent…
Jacob Gabrielson
  • 34,800
  • 15
  • 46
  • 64
5
votes
2 answers

Achieving NHibernate Nested Transactions Behavior

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…
jfneis
  • 2,139
  • 18
  • 31
4
votes
1 answer

SQL Try/Catch logic with nested transactions

The following sproc is implemented in accord with the template in this article: Exception handling and nested transactions. This sproc is supposed to handle deadlocks and it is called by another sproc that already creates a transaction. Some magic…
4
votes
2 answers

What's the case that requires nested transaction?

Even a transaction is nested, it won't be updated until outmost transaction commits. So what's the meaning of nested transaction and what's the specific situation that requires the feature?
eonil
  • 83,476
  • 81
  • 317
  • 516
3
votes
2 answers

Rails 3. Nested transactions. Exception in a child block

Why doesn't ActiveRecord rollback changes in nested transactions after exception was risen in a child block? Here are examples: 1. >> Client.transaction do ?> Client.create(:name => 'Pavel') >> Client.transaction do ?> Client.create(:name…
3
votes
1 answer

Recommendations regarding nested transactions in SQL Server

I have some "base operation" stored procedures, like BookAVehicle and UnBookAVehicle. They are both in a transaction. But now I need to have a somewhat more complex stored procedure: RescheduleBooking. It also needs to be transactional. Now, from…
barnonline
  • 315
  • 4
  • 11
1
2 3