Spring Bott 中的事务传播
我如何在Spring Boot中实现以下内容。我需要调用第一个m1(),然后调用m2()
m1和m2是2个不同类中的2个方法,它们调用2个不同的存储过程。P_CODE是m1和m2返回的输出值。
begin
m1()
if p_code==0
{
m2()
end transaction
}
else
{
end transaction
begin
m2()
end transaction
}
- 当m1返回的p_code为0时,m1和m2应该属于同一个 交易。
- 当m1返回的p_code不为0时,则m1和m2 应该属于不同的事务。
How can i implement the below in Spring Boot.i need to calls 1st m1() and then m2()
m1 and m2 are 2 methods in 2 different classes which calls 2 different stored procedure .P_CODE is the ouput value retuned by m1 and m2 .
begin
m1()
if p_code==0
{
m2()
end transaction
}
else
{
end transaction
begin
m2()
end transaction
}
- When p_code retuned by m1 is 0 then m1 and m2 should belong to same
transaction. - When p_code retuned by m1 is not 0 then m1 and m2
should belong to different transaction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论