distributed-transactions

XA Two Phase Commit and execution in Prepare Phase?

对着背影说爱祢 提交于 2020-01-23 03:39:07
问题 I am trying to understand two-phase-commit and it is not clear to me when each local site executes its portion of the distributed transaction. Does that happen before the prepare messages are sent. That is does it happen before the two-phase-commit xa protocol is even run? Or does each site executes its portion of the distributed transaction after receiving the prepare message, meaning the prepare message itself also includes the transaction query to be executed? 回答1: Yes, execution happens

Recommended practice for stopping transactions escalating to distributed when using transactionscope

删除回忆录丶 提交于 2020-01-22 13:55:49
问题 Using the TransactionScope object to set up an implicit transaction that doesn't need to be passed across function calls is great! However, if a connection is opened whilst another is already open, the transaction coordinator silently escalates the transaction to be distributed (needing MSDTC service to be running and taking up much more resources and time). So, this is fine: using (var ts = new TransactionScope()) { using (var c = DatabaseManager.GetOpenConnection()) { // Do Work } using

Why is 2-phase commit not suitable for a microservices architecture?

我是研究僧i 提交于 2020-01-12 08:00:05
问题 I've read a post saying that: We can not implement traditional transaction system like 2 phase commit in micro-services in a distributed environment. I agree completely with this. But it would be great if someone here can explain the exact reason for this. What would be the issues I'm going to face if I'm implementing 2-phase commit with microservices? Thanks in advance 回答1: The main reason for avoiding 2-phase commit is, the transaction co-ordinator is a kind of dictator as it tells all

.net detect distributed transaction

人盡茶涼 提交于 2020-01-04 13:04:29
问题 In my application I use the following pattern for calling the DB: //do a transaction using (TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required)) { OperationOnDb1(); //when we open the connection to the “other db” in this call, the transaction would become distributed OperationOnDb2(); //transaction is now distributed transaction.Complete(); } The problem is that Operation1 and Operation2 90% of the time use the same db ... but there are cases (bugs) when they

Transaction handling while using message driven channel adapter & service activator

大城市里の小女人 提交于 2020-01-02 16:30:09
问题 I am working on a POC which does the following Uses a message driven channel adapter to recieve message in a transaction Calls the Service Activator which uses a handler to insert the message recieved from the adapter to DB and also post message to outbound channel. Now, if the DB insert of the message fails i want the JMS message returned back to the queue so that it can be re-tried later. With my below configuration it doesnt seems to work.(i.e. even if there is a failure while inserting

Best way to handle LOBs in Oracle distributed databases

☆樱花仙子☆ 提交于 2019-12-31 14:52:13
问题 If you create an Oracle dblink you cannot directly access LOB columns in the target tables. For instance, you create a dblink with: create database link TEST_LINK connect to TARGETUSER IDENTIFIED BY password using 'DATABASESID'; After this you can do stuff like: select column_a, column_b from data_user.sample_table@TEST_LINK Except if the column is a LOB, then you get the error: ORA-22992: cannot use LOB locators selected from remote tables This is a documented restriction. The same page

The operation could not be performed because OLE DB provider “SQLNCLI10” for linked server “DB_PROD_04” was unable to begin a distributed transaction

爱⌒轻易说出口 提交于 2019-12-25 11:55:09
问题 I have two servers: SQL_UAT_01 DB_PROD_04 Both of these servers have the same database name and same tables: SQL_UAT_01.Database_01.TestTable DB_PROD_04.Database_01.TestTable There is a trigger on each of these two tables. When the trigger fires, it does a simple UPDATE on the table of the OTHER server. Example Trigger is fired here: SQL_UAT_01.Database_01.Test It does an update here: DB_PROD_04.Database_01.Test And vice-versa. I'm running into an error which I have no clue how to fix. Again,

XA Transactions between 2 JMS Brokers (ActiveMQ)

随声附和 提交于 2019-12-25 05:10:04
问题 I am trying to move jms messages between 2 different, remote, activeMQ brokers and after a lot of reading I am using Atomikos, as I am writing a standalone application, and I am also using spring to get the whole thing working. I have the following bean javaconfig setup @Bean(name="atomikosSrcConnectionFactory") public AtomikosConnectionFactoryBean consumerXAConnectionFactory() { AtomikosConnectionFactoryBean consumerBean = new AtomikosConnectionFactoryBean(); consumerBean

Distributed Application using Zookeeper

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 03:58:16
问题 I need to design distributed application using zookeeper. This is the first time I am using Zookeeper so I am little confused with its usage. I have read that Zab protocol ensures serializability when it comes to multiple updates but I am unable to understand, if that is the case than it will automatically allow lock free implementation. So why locks are needed in first place? It will be great if some one can help here. Thanks 回答1: Zab protocol is a critical PART of zookeeper.It ensures

How to enable transaction management in spring application running on multiple JVMs

混江龙づ霸主 提交于 2019-12-25 00:58:28
问题 I have started using Spring framework from last few months. I have a question on how the transaction manager works in the below scenario. Scenario : I'm working on a spring batch in which the ItemReader calls the below method multiple times. This method fetches the list of records from the 'STUDENTS' table which are in status 'NOT COMPLETED' and updates the status of these records to 'IN PROGRESS'. I'm processing 10 million records hence I'm planning to execute my batch process using multiple