distributed-transactions

XA/JTA transaction: JMS message arrives before DB changes are visible

亡梦爱人 提交于 2019-12-04 06:54:50
Context is: producer (JTA transaction PT ) is both sending message to JMS queue and making DB update; consumer (JTA transaction CT ) listens on same queue and reads DB when message is received; application server - WebLogic, DB - Oracle. I've observed, that sometimes CT is not (yet?) able to see DB changes of PT , event if corresponding JMS message is already received ( PT is committed?). It seems that JTA can't guarantee consistency of such kind (this was also confirmed in Jurgen Holler's presentation "Transaction Choices for Performance" ). What is the best way to avoid such problem (except

How to do distributed transaction cordination around SQL API and GraphDB in CosmosDB?

拥有回忆 提交于 2019-12-04 06:06:09
问题 I have a Customer container with items representing a single customer in SQL API (DocumentDB) in CosmosDB . I also have a Gremlin API (GraphDB) with the customers' shoppingcart data. Both these data are temporary/transient. The customer can choose clear shopping cart which will delete the temporary customer and the shoppingcart data. Currently I make separate calls, one to the SQL API (DocumentDB) and Gremlin API (GraphDB) which works but I want to do both as a transaction (ACID principle).

Why does Azure Database perform better with transactions

南楼画角 提交于 2019-12-04 03:43:40
We decided to use a micro-orm against an Azure Database. As our business only needs "inserts" and "selects", we decided to suppress all code-managed SqlTransaction (no concurrency issues on data). Then, we noticed that our instance of Azure Database responded very slowly. The " rpc completed " event occured in delays that are hundreds times the time needed to run a simple sql statement. Next, we benchmarked our code with EF6 and we saw that the server responded very quickly. As EF6 implements a built-in transaction, we decided to restore the SqlTransaction (ReadCommited) on the micro-orm and

Deadlocks causing 'Server failed to resume the transaction' with NHibernate and distributed transactions

烂漫一生 提交于 2019-12-04 01:50:02
We are having an issue when using NHibernate with distributed transactions. Consider the following snippet: // // There is already an ambient distributed transaction // using(var scope = new TransactionScope()) { using(var session = _sessionFactory.OpenSession()) using(session.BeginTransaction()) { using(var cmd = new SqlCommand(_simpleUpdateQuery, (SqlConnection)session.Connection)) { cmd.ExecuteNonQuery(); } session.Save(new SomeEntity()); session.Transaction.Commit(); } scope.Complete(); } Sometimes, when the server is under extreme load, we'll see the following: The query executed with cmd

Why do we need service bus frameworks like NService Bus/MassTransit on top of message queuing systems like MSMQ/RabbitMQ etc?

左心房为你撑大大i 提交于 2019-12-03 18:00:08
问题 In the distributed message transaction world, am trying to understand the different parts that are involved in developing distributed systems. From what I understand you can design messaging system using enterprise bus backed with a message queue system. Why is it a good idea to use both? Can the same be achieved by programming against just the message queuing system? What are the advantages of using both together? 回答1: You certainly can code directly against the messaging infrastructure and

How does the banking transactions work “under the hood” - possibly in detail

偶尔善良 提交于 2019-12-03 16:58:22
问题 I'm wondering how does the banking transactions work. It is very hard to find some at least acceptable explanation. I dont mean some basic distributed transaction algorithms for not that serious businesses. So what kind of measures must bank take to keep consistency, to never loose not a single penny. What about internacional transactions, transactions between banks. Data consistency across the whole world - not to withdraw all the money in NY and then repeat in Tokio once again.. And any

Java: XA Transaction propagation within many threads

不打扰是莪最后的温柔 提交于 2019-12-03 13:49:14
问题 How can I use a transaction manager (such as Bitronix, JBoss TS or Atomikos) in a Java SE (not Java EE or Spring) to support the following use case: Let's assume we have the following class: public class Dao { public void updateDatabase(DB db) { connet to db run a sql } } and we create a Java Runnable from that, like the following: public class MyRunnable extends Runnable { Dao dao; DB db; public MyRunnable(Dao dao, DB db) { this.dao=dao; this.db = db; } public run() throws Exception { return

Recommended practice for stopping transactions escalating to distributed when using transactionscope

萝らか妹 提交于 2019-12-03 11:57:26
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 (var c = DatabaseManager.GetOpenConnection()) { // Do more work in same transaction using different

EF: db.SaveChanges() vs dbTransaction.Commit

↘锁芯ラ 提交于 2019-12-03 09:02:28
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 we can create a transaction of our own using db.Database.BeginTransaction() ,"db" being my context class object. So I have two questions: What to use & when If I am inserting data to one table whose @@identity is foreign key to my next inserting table, rather than using db.SaveChange() to get the @@identity is there any other way ( db.SaveChanges() is in a user defined transaction scope) and will

Does the CAP theorem imply that ACID is not possible for distributed databases?

你说的曾经没有我的故事 提交于 2019-12-03 07:52:43
问题 There are NoSQL ACID (distributed) databases, despite CAP theorem. How this is possible? What's the relation between CAP theorem and (possible/not possible of) being ACID? Is impossible for a distributed computer system to simultaneously provide consistency, availability and partition tolerance. 回答1: CAP theorem is actually a bit misleading. The fact you can have a CA design is nonsense because when a partition occurs you necessarily have a problem regarding consistency (data synchronization