开发者

Best practice for master-detail Insert data in biz layer?

开发者 https://www.devze.com 2023-02-07 06:16 出处:网络
Do you have any offer for master-detail i开发者_StackOverflownsert data into database? Do you use Transaction? What is the best practice for it?How do you control it in biz layer?It all depends on the

Do you have any offer for master-detail i开发者_StackOverflownsert data into database? Do you use Transaction? What is the best practice for it? How do you control it in biz layer?


It all depends on the business rules. If it is ok for one insert to happen but not another then a transaction is not required. If however the business rules mean that each insert must occur together than yes, use a transaction.

Best practice is to understand and document the problem being solved to a sufficient degree to understand the situation and then design something that reflects that understanding - therefrore without the context we can not give a specific best practice recommendation. Although you could try to describe the context of the question and see if we can then be more specific

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号