Questions tagged [nested-transactions]

43 questions
2
votes
1 answer

Rollback nested transaction and log error - in Trigger, Sql Server 2008

I have a trigger (that may modify a value on the insert) on insert statements to a table. If an error occurs in the trigger, I want to log it. And the INSERT must still be inserted. So I use a TRY / CATCH block, where the catch part, will do the…
jma73
  • 91
  • 2
  • 7
2
votes
0 answers

Nested Transactions with MySQL and Entity Framework Core

I'm using MySQL with EF Core. I am currently using Pomelo Provider for MySQL. I need to implement Unit Of Work Pattern for transactions. I have a Service which calls two methods in repository. I am not able to implement nested transactions. This is…
2
votes
1 answer

Is it possible for parent transaction to fail if nested transaction was successfully committed

I'm trying to understand nested transactions in SQL Server. Lets consider following chain for SQL commands: BEGIN TRANSACTION; -- #1 BEGIN TRANSACTION; -- #2 UPDATE foo SET column = 'something'; -- Change something in one table. COMMIT TRANSACTION;…
Mariusz Jamro
  • 30,615
  • 24
  • 120
  • 162
2
votes
3 answers

Total rollback on nested transactions

I really like this NestedPDO solution for Yii but I need some different transaction handling. I want to commit my nested transactions only if all nested transactions could be commited and if ONE transaction does a rollback all transactions should…
sandro1111
  • 63
  • 1
  • 8
1
vote
0 answers

Nested transactions and @@trancount count (issue with the practice question for 70-761)

Got a practice question from Measure up and not sure if it is badly worded or I'm missing something regarding nested transactions. Basically gives me a definition of a stored procedure and states When the sp is run, what is the value of…
SQLBoffin
  • 21
  • 4
1
vote
0 answers

Transaction Per Request Middleware Not working

I am trying to add a middleware so that transaction begins at the beginning of the request and commits or rollbacks depending on the situation. This is my middleware: public class TransactionPerRequestMiddleware { private readonly…
1
vote
2 answers

nhibernate and nested transactions

I know that nhibernate doesnt support nested transactions. Let's say that I got something like this: UserService.BeginTransaction (on current session) UserService.Save UserService->FeedService FeedService.BeginTransaction (on current…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
1
vote
4 answers

Nested Transaction in nested stored procedures

Actually, I got a little confused about using nested transaction in stored procedures. I need to call the two/three procedures with in one main procedure. Eg: Begin try Begin Tran -- 1st level transcation Procedure 1 --will be executed Procedure…
King_Fisher
  • 1,171
  • 8
  • 21
  • 51
1
vote
1 answer

Spring transactions: Method with requires_new called from a method with requires

I would like to understand when exactly commit happens and when exactly rollback happens in case of nested transaction with different isolation levels to calling and called methods, For example, I have two spring services and i'm calling method2 of…
Rama
  • 13
  • 1
  • 6
1
vote
1 answer

.NET Data Providers - How do I determine what they can do?

I have code which could be executed using a Provider that doesn't support transactions, or doesn't support nested transactions. How would I programmatically determine such support? E.g. The code below throws a System.InvalidOperationException on the…
rbellamy
  • 5,683
  • 6
  • 38
  • 48
1
vote
1 answer

Nested transactions in Neo4j

For the record, I am using Neo4j 2.0.0-M02. I currently have a method which can search nodes with the label "User" on their user id which is stored in the graph as a node property "id". This all happens in a transaction, as that automatically closes…
Pieter-Jan
  • 1,675
  • 2
  • 19
  • 25
0
votes
0 answers

When will the PESSIMISTIC READ lock be released if we use it within nested transaction?

We use a Spring Boot 2.5 with Java 17 and Postgres DB. We have a method example() annotated with @Transactional(propagation = Propagation.NESTED). Within example() method we use repository method "getData()" which has…
0
votes
1 answer

Mismatched number of SQL Server Transactions in LinkedServer

I have a linked Server connected from ServerA to ServerB. In each server there is an SP that initiates a transaction and it is necessary for one ServerA.SP to be executed within ServerB.SP. My problem is that when doing that, I get the…
0
votes
1 answer

Firebase transaction() returning with blank item before providing populated item

I am using transaction in my realtime database as follows: admin.database().ref(`/users/${uid}`).transaction((user) => { if (user) { console.log("user exists"); // ... modify the user ... …
0
votes
2 answers

How to set nestedTransactionAllowed to true in Spring?

I have a case where I need to initiate calls to four different services in the same method. According to our business logic all four steps must succeed, rollback otherwise. The problem is that since all the steps occur in the same transaction (via…