distributed-transactions

Two phase commit

不想你离开。 提交于 2019-11-28 13:50:44
问题 I believe most of people know what 2PC (two-phase commit protocol) is and how to use it in Java or most of modern languages. Basically, it is used to make sure the transactions are in sync when you have 2 or more DBs. Assume I've two DBs (A and B) using 2PC in two different locations. Before A and B are ready to commit a transaction, both DBs will report back to the transaction manager saying they are ready to commit. So, when the transaction manager is acknowledged, it will send a signal

Distributed Transaction on Linked Server between sql server and mysql

半腔热情 提交于 2019-11-28 03:45:00
问题 I have a table say Table1 on SQL Server 2014 and MySQL both. Table1 ID INT,Code VARCHAR(100) I created a linked server MyLinkedServer in SQL Server using "Microsoft OLEDB Provider for ODBC". **Linked Server ** EXEC master.dbo.sp_addlinkedserver @server = N'MyLinkedServer', @srvproduct=N'MyLinkedServer', @provider=N'MSDASQL', @datasrc=N'MyLinkedServer' EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'MyLinkedServer',@useself=N'False',@locallogin=NULL,@rmtuser=N'username',@rmtpassword='######

TransactionScope: Avoiding Distributed Transactions

萝らか妹 提交于 2019-11-27 19:26:33
I have a parent object (part of a DAL) that contains, amongst other things, a collection ( List<t> ) of child objects. When I'm saving the object back to the DB, I enter/update the parent, and then loop through each child. For maintainability, I've put all the code for the child into a separate private method. I was going to use standard ADO Transactions, but on my travels, I stumbled across the TransactionScope object, which I believe will enable me to wrap all DB interaction in the parent method (along with all interaction in the child method) in one transaction. So far so good..? So the

Distributed transactions between MySQL and MSSQL

强颜欢笑 提交于 2019-11-27 18:41:23
问题 I've tried for nearly a week now to get distributed transactions working. I've some procedures on MSSQL which try to select data from MySQL. My need is to do this in one(!) transaction. At the time I've set up ODBC connection on MSSQL with Single-Tier MySQL driver from OpenLink, which states me, that XA transactions work successfully (there is a test button integrated after configuring ODBC connection). Then I've set up a linked server in MSSQL via MSDASQL to this ODBC connection, but when

Delivery of JMS message before the transaction is committed

雨燕双飞 提交于 2019-11-27 12:47:13
I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the insert has been committed in the database. This is actually understandable if we consider the 2 phase commit protocol: 1. prepare JMS 2. prepare database 3. commit JMS 4. ( tiny little gap where message can be delivered before insert has been committed) 5. commit

Kafka - How to commit offset after every message using High-Level consumer?

我是研究僧i 提交于 2019-11-27 10:20:58
问题 I'm using Kafka's high-level consumer. Because I'm using Kafka as a 'queue of transactions' for my application, I need to make absolutely sure I don't miss or re-read any messages. I have 2 questions regarding this: How do I commit the offset to zookeeper? I will turn off auto-commit and commit offset after every message successfully consumed. I can't seem to find actual code examples of how to do this using high-level consumer. Can anyone help me with this? On the other hand, I've heard

TransactionScope: Avoiding Distributed Transactions

孤街醉人 提交于 2019-11-26 22:48:22
问题 I have a parent object (part of a DAL) that contains, amongst other things, a collection ( List<t> ) of child objects. When I'm saving the object back to the DB, I enter/update the parent, and then loop through each child. For maintainability, I've put all the code for the child into a separate private method. I was going to use standard ADO Transactions, but on my travels, I stumbled across the TransactionScope object, which I believe will enable me to wrap all DB interaction in the parent

Delivery of JMS message before the transaction is committed

混江龙づ霸主 提交于 2019-11-26 16:07:41
问题 I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the insert has been committed in the database. This is actually understandable if we consider the 2 phase commit protocol: 1. prepare JMS 2. prepare database 3. commit JMS