Web Services Transaction Management

Our client follows SOA principles and has design web services that are very small, such as createCustomer, deleteCustomer, etc.

I'm not sure if fine-grained services are needed, as they create transaction-related problems. eg. if a business requirement - each Client must have an address when it is created. Thus, in this case, the view component first calls createCustomer and then createAddress. Services that internally use simple JDBC to update related tables in db. Since the service is called by an external component, it does not fulfill the transaction requirements here, that is, if createAddress fails, the createCustomer operation must be rolled back.

I assume that one of the approaches to solving this issue is either designing the services aimed at the final result (which the Client creates and the associated address in one JDBC transaction) or perhaps just create a reverse service (deleteCustomer) that simply cancels the createCustomer action.

any suggestions. thank

+3
source share
3 answers

Short answer: services should be designed for the convenience of customer service. If the customer is told: "Call it, then cdon't forget to call it" you make your life too complicated. There should be a coarse service.

Long answer: Is it possible to reasonably enter a client without an address? Therefore we call

createCustomer( stuff but no address)

( , ) .

changeCustomerAddress ( customerId, Address)

.

API . , , "" - , . , , , , , , .

createCompleteCustomer(), - , .

:

). - Atomic Transactions . . , , , .

). (, , ), @mtreit. , , . ? memeory, , , . - , , .

+3

, :

SOA - , , createCustomer, deleteCustomer ..

, SOA , , - . SOA (, OData ) , 25 . SOA - , CORBA SOA dudes , 10 CORBA. , - , SOA , - CORBA.

, , .

, -. . , , . , , , , ( , . ).

, -, , - (WS *) , , -. WS-Atomic.

- (a.k.a. WCF MS, java-), . iof - , , , , , .

java, MS, : http://msdn.microsoft.com/en-us/library/ms752261.aspx

-, , , , SOA. , , . SOA - , , , , 10 .

, . - -, , - - , , , / , . 10 30-40 , . SOA ( , ), , / , OData.

+2

, , , .

, , , , . , Commit, , ; , , Commit , .

, , - , , .

0

Source: https://habr.com/ru/post/1769845/


All Articles