The data access layer contains the problem of business logic

zhaozj2021-02-16  127

We know that for XXXXX, we need to encapsulate commercial logic to the commercial logic layer (Data Access) to the Data Access Component.

There is such a problem, some database access operations need to be included in DB Transaction, but there may be some business logic in a DB Transactoin (I am not sure, whether the business logic in DB Transaction is definitely available), and The business logic layer should not involve the database operating level Transaction, which is inevitable to include some business logic to the data access layer?

One possible resolution case is to encounter a complicated transaction operation, the business logic layer controls the transaction, before the transaction operation, the record initial state, and roll back to the original state in the Compensation step when there is an error in one step. For example, I have recorded insert, and then in Compensation, I passed the record of the DELETE in Compensation.

I don't know if I have incomplete to business and business logic, or is it really a problem that I often confuse everyone? Who is good suggestion?

转载请注明原文地址:https://www.9cbs.com/read-7726.html

New Post(0)