提交嵌套在另一个事务中的特定事务 - Coldfusion - Hibernate
即使父事务进入 catch 和 rollack,也需要执行一个代码片段,
transaction action="begin" nested="true" isolation="read_uncommitted"{
try{
transaction {
//more code...
}
transaction{
//my code that needs to be committed anyway, even though the parent transaction of rollback
}
}catch(Any e){
transaction action="rollback";
}
}
这是我当前代码的一个非常简化的示例。如何强制提交这个单点代码?
there is a code snippet that needs to be executed even if the parent transaction enters catch and rollack
transaction action="begin" nested="true" isolation="read_uncommitted"{
try{
transaction {
//more code...
}
transaction{
//my code that needs to be committed anyway, even though the parent transaction of rollback
}
}catch(Any e){
transaction action="rollback";
}
}
this is a very simplified example of my current code. How do I force commit this single point of code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
finally{}
代码块。请参阅文档 这里。Use a
finally{}
code block. See documentation here.