fix:主事务内多个嵌套事务,导致影响主事务提交|回滚 #532
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (check at least one)
The description of the PR:
这个主要原因是由于当初想通过每个连接的保存点名称计数,根据调用栈的深度来释放掉SavePointHolder对象,当到达外层调用栈时最后一个savepoint会返回0(即第一次为savepoint0),但是如果某一层级多个嵌套事务的话就会导致order连接创建出savepoint计数为1的保存点,所以当保存点释放、回滚时会出现即使SavePointHolder持有的savepoint集合为空(已经释放回滚干净)但计数未<=0不满足条件,无法删除空持有的SavePointHolder对象,因此影响主事务提交|回滚。今天那个pr虽然会再次判断这个savePointHolder持有的savepoints集合是否为空来作为存在保存点的条件但是仍然会多出一个空持有对象,因此通过将保存点释放、回滚时删除savepoint集合持有对象(SavePointHolder)的条件改为为SavePointHolder中savepoints集合是否为空
Other information:
#531