All Questions
Tagged with distributed-transactions transactions
143 questions
0
votes
1
answer
208
views
ASP.NET Core 6 and EF Core - distributed transaction
We have upgraded recently from .NET Core 2.2 to .NET 6.0 and we encounter several issues. One of them is related to using System.Transaction which somehow is being upgraded to distributed transaction ...
2
votes
0
answers
180
views
How do distributed locks work in Spring Data JPA repository level?
Let's imagine we have an application that has 3 instances and 1 DB (there might be more synchronized DBs) and we have a withdraw method that basically selects the account from account table with @...
0
votes
1
answer
104
views
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 ...
0
votes
0
answers
118
views
Running two JDBC transactions for different databases - will it work?
I want to make transactional update in two databases. Given I have following pseudocode:
try {
Connection conn1 = DriverManager.getConnection("jdbc:postgresql://HOST1", "postgres1&...
0
votes
1
answer
41
views
How to rollback all the insert and update that are done in different tables from different function calls that are called through the single api
I am calling an API to save the production data, I need to save various details like batch no, machine no, and process in different database
Class ProductionImpl{
public Long saveProduction(...
0
votes
0
answers
533
views
Read uncommited data using transaction id in postgres after prepare transaction
I have a use case as below:
Prepare a transaction and keep this transaction id.
Do some operations in multiple sessions using the same transaction id.
Do some operations in any external system.
Do ...
3
votes
2
answers
922
views
Design / Implement Transactional Outbox pattern in schema isolated multitenant application
I have a multi-tenant application. The tenants data is isolated based on schema.
I want to implement a transactional outbox pattern, where I want to store the events in a table (in same transaction)...
1
vote
0
answers
138
views
2 phase commit data consistency when one node crashes or is slow during commit phase
In 2 phase commit, lets say one of the nodes crashes or is slow during the commit phase and the other nodes have already successfully committed their changes. Now if a query is issued to one of those ...
0
votes
0
answers
1k
views
Distributed transaction in .net core 3.1
Hi I am having a simple worker service project in .net core 3.1.
For one of the functionality i need to have distributed transaction.
I referred the example described here.
I am not getting any ...
0
votes
2
answers
1k
views
Transactions Across Microservices
I have two entities:
Entity A:
private Long idA;
Entity B:
private Long idB;
private Long fkA;
My Micro Service can save, modify or delete only the B entity :
Repository:
@Repository
public ...
3
votes
0
answers
1k
views
PostgreSQL with JSONB vs MongoDB
For a social media platform that I'm developing, I need to model the database for the user content. The content published by the user will be typically title, description, comments with replies and ...
0
votes
1
answer
222
views
How would you build a in-memory database which is transaction safe? ACIDITY is key here
I have been tasked to build an in-memory database that is transaction safe? Which technologies will be easier to implement? Any references are much appreciated;
I am not sure how to implement that? In ...
0
votes
1
answer
385
views
Extremely slow transaction commit on multi-node Hazelcast cluster
We are experiencing an extremely slow commit to hazelcast randomly with 2 node hazelcast server. We have XA transaction manager with database and hazelcast participating in same transaction and ...
-1
votes
1
answer
791
views
Stored Procedure and REST API call as a transaction
Imagen that you have a stored procedure in a database that you call from PHP. That procedure works like a transaction and selects/inserts data into the database. If it succeeds it commits, if it fails ...
0
votes
0
answers
884
views
Spring Boot 2 Transactional Annotation Not Working
Question regarding our Spring Boot 2.3.8.RELEASE implementation of @Transactional. The requirement is to implement distributed transactions that writes to an instance of PostgreSQL and ActiveMQ ...
1
vote
1
answer
147
views
TransactionManager.DistributedTransactionStarted event is not fired when using SQL Azure database
I need to detect transaction promotion in a big project (I want to log call stacks of those cases). I'm using the TransactionManager.DistributedTransactionStarted event to detect such a cases. It ...
5
votes
1
answer
2k
views
Why is replica set mandatory for transactions in MongoDB?
As per MongoDB documentation, transactions only works for replica sets and not single node. Why such requirement? Isn't it is easier to do transaction stuff on a single node rather than a distributed ...
0
votes
1
answer
66
views
how two phase commit ensure serializability
Two phase commit is used in distributed transaction. For example, a client sends a transaction to two databases with a coordinator.
step1: client get a global transaction id from coordinator
step2: ...
1
vote
2
answers
686
views
Amazon Document DB: How to Implement multi-document transactions
When using mongo template to start a session for transaction in document db cluster.
public class DocDBService() {
@Autowired
MongoTemplate mongoTemplate;
@Autowired
MongoTransactionManager ...
0
votes
1
answer
128
views
What is exactly the process of transaction manager in JTA
After reading a lot of blogs about JTA, there is still some points confuse me.
For example I found in JTA Example
The blog provide a picture to explain relationship between components of a ...
0
votes
1
answer
139
views
Could I just always flush a write ahead log instead of implementing a Two-Phase Commit protocol?
I have trouble understanding parts of the two-phase commit protocol. I don't understand how the second phase helps at all.
As far as I understand, the second (completion) phase can fail just as if we ...
0
votes
1
answer
382
views
how can I do conditional insert in postgres when there can be concurrent inserts that can create conflict?
I am trying to write an experimentation framework where user can schedule some experiments based on location-ids and time.
my table schema looks like :
TABLE experiment (
id INT NOT NULL ...
3
votes
1
answer
2k
views
Distributed transaction among services in a microservice system, using spring-cloud
The current situation
Got a project using: spring-boot, spring-cloud, postgresql, as a microservice system.
There are 2 services, say SA and SB, they operate on 2 RDBMS databases respectively, say ...
3
votes
1
answer
4k
views
Distributed transactions with RabbitMQ in spring boot application
Currently working on migrating a monolith app into micro services and I want to know how to achieve the distributed transaction in across application. Is there any examples for RabbitMQ handling ...
0
votes
1
answer
2k
views
How to resolve Runtime error no transaction is active?
I am dealing with a legacy program written in Visual Basic the source code of which is unfortunately unavailable to me. The set up I have is the following.
There is a server, lets call it S, and two ...
0
votes
1
answer
179
views
How to work with database B within the scope of Spring-managed transaction on database A, all without XA?
To begin with, this question is not about applying an external XA transaction manager, as this would definitely solve the problem. The question is how go around without it assuming the following:
...
5
votes
3
answers
7k
views
What is a transaction boundary?
I've read this article (assumes I already know what a transaction boundary is) and this SO question (can't decipher meaning of transaction boundary from that question). In other words, there are no ...
0
votes
1
answer
593
views
MuleSoft: XA Transaction management for two different REST Call
We have a situation where we need to manage db transaction across multiple rest api call.
In traditional example where new customer is registered, ordered, and payment done with different micro ...
0
votes
1
answer
520
views
What to do if a transaction fails?
So basically there is a game where you own a planet, you send ships to other planets, and after a bit you can own that new planet.
PlanetB is being attacked with a ship:
[PlanetA] ----> [PlanetB]
...
1
vote
0
answers
34
views
How do 2PC prevent commit failure? [duplicate]
I am new to distributed transaction thing, studying how two-phase commit works across a distributed transaction in micro-services architecture. As per my understanding, in the last part of the phase ...
0
votes
1
answer
240
views
How to configure: WS-AT Narayana standalone?
I want to use Narayana - WS-Transaction in a standalone springboot app that calls two different Webservics in a single transaction. One of those internally uses db resource for insert/update.
Is ...
21
votes
1
answer
24k
views
EF: db.SaveChanges() vs dbTransaction.Commit
I am fairly new to entity framework and I have a doubt on EF's db.SaveChange. From some posts and MSDN I learned that db.SaveChange by default does all the changes in transaction. Also there is a way ...
1
vote
1
answer
835
views
Can SQL reads return stale data?
Consider the following SQL transaction sequence:
// @TransactionOne
BEGIN TRANSACTION;
CREATE TABLE T (C INT, D INT);
INSERT INTO T VALUES (1, 2);
COMMIT;
// @TransactionTwo
BEGIN TRANSACTION;
...
7
votes
1
answer
6k
views
.NET TransactionScope and MSDTC
In my code there are transactions to handle:
using (var scope = new TransactionScope())
{
repo1.SaveSomething();
repo2.SaveAnythingElse();
scope.Complete();
}
Inside repo1 and repo2 functions ...
7
votes
1
answer
251
views
Azure failed to marshal transaction into propagation token for elastic transaction (Works for MSDTC)
In windows azure we have hosted two asp.net webapi project as app service. We need to enable distributed transaction here. We initiate transaction inside one api. Then inside that transaction scope we ...
1
vote
1
answer
780
views
Configuring transaction across multiple resources using spring framework?
I understand the fact that a transaction that spans multiple transactional resources is called a global transaction.
Question 1:
Is this just an another name for distributed transaction or is that ...
0
votes
0
answers
834
views
The transaction has aborted error though
I am using EF6 with code first approach. I have a case where I am trying to apply same transaction over 2 different databases. Find my code below for the reference,
using (var scope = new ...
1
vote
0
answers
59
views
Is READ COMMITED transactional isolation level implicity when using FOR UPDATE?
After scouring the internet for information about Transactional Isolation levels, I understood that Row Locking in MySQL can be achieved by using either SELECT...FOR UPDATE or LOCK IN SHARE MODE and ...
1
vote
1
answer
953
views
Why is DbContext.Database.CurrentTransaction always null?
Is there anyway to find if a DbContext is enlisted in any transaction while enlist=false in the connection string?
I was tracing DbContext.Database.CurrentTransaction, but I noticed it is always null.
...
2
votes
0
answers
997
views
How to put multiple web service calls under one transaction in asp.net
I am working on an asp.net application which has a registration module. To complete this registration process, we are making three different 3rd party web service calls (these services are Rest as ...
0
votes
0
answers
1k
views
Distributed Transaction vs Message Queue
I am trying to implement distributed transactions in my current application which are working fine currently with MSDTC, the only problem is that MSDTC is only supported in windows. The alternative ...
1
vote
1
answer
2k
views
Java - Heuristic Exception
Can anyone share how to generate or simulate HeuristicCommitException using Atomikos?
Thanks.
0
votes
1
answer
964
views
In EJB how @TransactionAttribute(TransactionAttributeType.REQUIRED) will commit my jdbc transaction as well?
In EJB I have found that there is an annotation available like @TransactionAttribute(TransactionAttributeType.REQUIRED) , So transaction will be managed by container itself. But with use of it, you ...
0
votes
2
answers
367
views
Do database drivers need to support distributed transactions or the support needs to have by database itself?
I am trying to understand the distributed transactions in Java EE. After reading some online materials and books I came to know that in Java EE, there is specific API, called as JTA which is one of ...
0
votes
1
answer
195
views
TransactionContext in hazelcast, anything like this in Ignite?
"HazelCast" has TransactionContext , is there anything similar to the same functionality which is available in "ApacheIgnite",
What my understanding on TransactionContext is, which is a temp storage ...
0
votes
1
answer
115
views
Challenge: Active Replication for Bank?
I have a question about active replication and ordering. I am aware that traditionally active replication in a distributed system requires total ordering to propagate requests to replicas, however, I ...
7
votes
2
answers
2k
views
Why is two-phase commit considered atomic?
Two phase commit is described as an "atomic commitment protocol". I would expect this to mean that all clients see the state of the world from either before a transaction commits, or after it commits -...
1
vote
1
answer
484
views
Distributed Transaction using WCF
We have a requirement for a very specific scenario to implement distributed transaction in WCF service. Here is the scenario:
Client makes a call to WCF Service
WCF Service updates Data in SQL ...
0
votes
1
answer
865
views
JMS Local transactions vs TransactionManager
I have been looking into the Jms API lately and I am not certain I understand the local vs transaction manager differences.
Scenario 1:
Consume message from Jms broker, process the message and ...
1
vote
3
answers
2k
views
How can we update documents transactionally in couchbase?
I have a use case in which there are three documents and I want to update them transactionally i.e. if any of them fails then other too should not get updated in the database. I was looking for an ...