distributed-transactions

How do you handle validation in composite microservice request?

陌路散爱 提交于 2019-12-12 11:20:12
问题 Consider an application with two entities: User (contains basic user data, such as name) Passport (contains authentication credentials, i.e. password) And two internal microservices: UserService (responsible for creating and managing users and their basic data) AuthService (responsible for user authentication and password handling) The User entity belongs to the UserService and Passport entity belongs to the AuthService . Those two services should be separated, because they solve very

Accessing transaction status in container managed beans

孤街浪徒 提交于 2019-12-12 10:59:59
问题 I have a @Stateless EJB using container managed transaction. Is there a way to access the "status" of javax.transaction.UserTransaction ? That is, calling UserTransaction.getStatus() inside the bean methods? I know access to UserTransaction is prohibited in container managed beans, but I would like to know, is there any other way to get access to getStatus() method? 回答1: I don't think you've understood the responsibility of the UserTransaction class. It does not exist to provide you with

Exception causing windows service to crash on ending distributed transaction with NHibernate

旧城冷巷雨未停 提交于 2019-12-11 18:30:52
问题 I have a windows service written in the .NET 4.0 framework that uses NHibernate enlisting in a distributed transaction talking to an Oracle database. Within our test environment the service encountered an error with the database which seems to have caused a problem with NHibernate closing the ADO.NET connection. The entire call against NHibernate, from opening the session to disposing of it, is wrapped within a try/catch block that catches System.Exception but the error is not caught within

Performance Overhead of XA Data Sources - Best Practices

妖精的绣舞 提交于 2019-12-10 15:47:18
问题 I am trying to understand the Impact of XA Datasources on Performance. In many applications, it happens that not all the transactions need to participate in Distributed Transactions (meaning only a few transactions require to be distributed/participating with other resources). Is the trade-off of the performance high enough to have two data sources configured (one each for XA and non-XA)? Again, the answer is, it depends on the scenario, but I am looking for "Best Practices". 回答1: It is worth

How to do 2 phase commit between two micro-services(Spring-boot)?

感情迁移 提交于 2019-12-10 07:49:56
问题 I Have two mico-serives A and B where they connect to seperate database, From Mico-serives A i need to persist(save) objects of both A and B in same transtation how to achive this. I am using Spring micro-servies with netflix-oss.Please give suggestions on best way to do achive 2 phase commit. 回答1: you can not implement traditional transaction system in micro-services in a distributed environment. You should you Event Sourcing + CQRS technique and because they are atomic you will gain

Spring cloud task's SimpleTaskConfiguration and spring batch's SimpleBatchConfiguration preventing spring boot auto configuration of XA transactions

限于喜欢 提交于 2019-12-08 19:53:01
问题 I am trying to configure XA/distributed transactions for a spring batch / spring cloud task application configured with spring boot. I have added the following dependency hoping to rely on spring boot auto configuration: compile("org.springframework.boot:spring-boot-starter-jta-atomikos") However the following two classes cause two transaction managers to be configured: org.springframework.cloud.task.configuration.SimpleTaskConfiguration org.springframework.batch.core.configuration.annotation

Will a WCF client throw a protocol exception when a client\service transaction is aborted on the service side and no faults are thrown?

妖精的绣舞 提交于 2019-12-08 06:44:37
问题 I have an existing web service where transaction flow was not supported and returns errors in an error collection of the response rather than throwing faults. So the response message contract looks like this: [MessageContract()] public class UpdateResponse { [MessageBodyMember()] public UpdateData Data { get; set; } [MessageBodyMember()] public ErrorMessages Errors { get; set; } } Now this service will be updated so its operations can be included in a distributed transaction, which will be

nhibernate and transactionscope transaction aborted spontaniously

北慕城南 提交于 2019-12-08 06:37:32
I am working with Nhibernate and TransactionScope in a large application. The application is supposed to modify 3 databases and support a distribuited transaction across them. This is the code that I call each time I want to query or execute some sql on the database within the distribuited transaction: IDbConnection connection = new SqlConnection(connectionString); connection.Open(); ISession session = SessionFactory.OpenSession(connection); And this is the code called whenever after the necessary operations are executed IDbConnection sqlConnection = session.Connection; if (sqlConnection !=

Distributed transactions in microservices

梦想的初衷 提交于 2019-12-07 06:19:42
问题 I have 2 microservices S1 and S2 . S1 invokes S2 to update a data and then S1 inserts another data,But let's consider S1 fails,Then we need to rollback the data updated by S2 or else we'll be in inconsistent state. I also gone through Saga patterns.will it satisfy this inconsistency Can anyone suggest any better solutions for this? 回答1: Distributed transactions are problematic for most circumstances and they are bad for services Service Boundary – service boundary is a trust boundary. Atomic

How to achieve immediate consistency in microservice architecture?

Deadly 提交于 2019-12-06 10:55:10
问题 For example amazon.com; they rely on microservice architecture and probably order and payment are seperate micro services but when you checkout order on amazon.com you can finally see the order id and details.If it's not eventual consistency approach what is it? Maybe 2PC? I'm generalizing my question; what if eventual consistency is not appropriate for business transaction(end user should see the result end of transaction) but seperate microservices is meaningful(like order and payment) how