algorithm that coordinates all the processes that participate in a distributed transaction on whether to commit or rollback the transaction
Questions tagged [2phase-commit]
70 questions
3
votes
0 answers
Two Phase Commit vs Three Phase Commit
I am currently studying 2 phase and 3 phase commit.
The 3PC protocol tries to eliminates the 2PC protocol’s system blocking problem by adding an extra phase, preCommit. As mentioned here
According to this post, If the co-ordinator crashed at any…

HKIT
- 628
- 1
- 8
- 19
3
votes
1 answer
Two-phase commit (2PC) configuration with Atomikos
I am creating a sample application to test two-phase commit (2PC). I have taken the code bits used here from the Internet. I am using Spring, Hibernate and Atomikos with MySQL as the backend. I am using two databases and deliberately making the call…

shashikanthb
- 379
- 2
- 9
- 21
2
votes
3 answers
XA support for Microservices
Scenario: I have multiple XA compliant databases fronted by different microservices which perform CRUD operations on them. I need to perform a 2 phase commit among these microservices. This means that I have a server running which makes API calls…

Pulak Gupta
- 21
- 2
2
votes
1 answer
Outbox pattern - Message Relay without duplicates and unordering for any SQL and NoSQL DB
Dual write is a problem when we need to change data in 2 systems: a database (SQL or NoSQL) and Apache Kafka (for example).
The database has to be updated and messages published reliably/atomically.
Eventual consistency is acceptable but…

Eugene Khyst
- 9,236
- 7
- 38
- 65
2
votes
0 answers
2 phase commit implementation
I'm trying to implement a 2-phase commit over a document database which supports only single-phase commit using transaction info on the inserted data.
I understand the theory behind 2-phase commit, but in practice there are a few obstacles.
Let's…

Metheny
- 1,112
- 1
- 11
- 23
2
votes
3 answers
How ZooKeeper guarantees "Single System Image"?
In the Consistency Guarantees section of ZooKeeper Programmer's Guide, it states that ZooKeeper will give "Single System Image" guarantees:
A client will see the same view of the service regardless of the server that it connects to.
According to…

zhumengzhu
- 698
- 5
- 22
2
votes
2 answers
What if commit fails in XA?
I am referring to the description of 2-phase commit at https://en.wikipedia.org/wiki/Two-phase_commit_protocol.
In the pre-commit phase, assume both resource managers have voted positively.
If the transaction manager initiates the commit by…

Yash
- 946
- 1
- 13
- 28
2
votes
0 answers
Two-phase commit vs Paxos
I am quite confused with these two technologies.
Are there any relationship between these two technologies
Are there any existing popular open source software implements these technologies? I know zookeeper implements Paxos but what about Two-phase…

Howard
- 19,215
- 35
- 112
- 184
2
votes
1 answer
How to implement 2pc in Zookeeper cluster?
I have a question regarding implementation two-phase-commit protocol in zookeeper cluster to coordinate certain transaction among multiple client connections. Right now I have the following idea:
Coordinator C register transaction node…

Rustem K
- 1,212
- 11
- 27
2
votes
2 answers
If I access UserTransaction does this mean that I use 2 phase commit or XA?
UserTransaction ut=lookup....
ut.beginTransaction();
saveToFooDB();
statelessEjb.transactionSupportedMethod(); //saves something to the Foo DB
saveToFooDB();
ut.commit();
If i was doing the above then my understanding is that it…

Aravind Yarram
- 78,777
- 46
- 231
- 327
2
votes
1 answer
PREPARE TRANSACTION releasing locks?
I must be missing something about PostgreSQL and two phase commit with PREPARE TRANSACTION.
The following SQL :
BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
UPDATE person.tcities set ctyname='L ABERGEMENT CLEMENCIAT TRANSACT' WHERE ctyid =…
anon
2
votes
3 answers
Transaction Processing Using PHP and MySQL
I'm trying to implement two-phase commit using PHP and MySQL, and coming up short.
The main block I've found is that I'm unable to store the MySQL connection resource in a place where I can find it again for the second phase. Is it possible to…

TomL
- 759
- 8
- 20
2
votes
2 answers
Implement two phase commit protocol between EJB Application(Running on Glassfish) and Swing application
I have a EJB application running on Glassfish server which stores data on MySQL DB which I call as Global DB.
I have two exact remote Swing applications which are stand alone applications accessing EJB's using RMI. They have their own local DB in…

qwerty
- 163
- 3
- 12
1
vote
1 answer
Can multiple REST calls participate in a distributed transaction?
Here's the scenario and by the way, I'm looking for a Java-centric answer.
Client code calls REST Service A (POST) from Provider Application #1.
Client code directly updates an internal database using JDBC.
Client code calls REST Service B (POST)…

user1281639
- 11
- 3
1
vote
1 answer
Using XA with databases that don't support it natively?
Is there an open-source Java library that adds XA support to databases that don't support it natively? That is, it wraps a non-XA JDBC datasource and takes care of the necessary commits/rollbacks behind the scenes for 2-phase commits?

Gili
- 86,244
- 97
- 390
- 689