Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug:IFreeSql的Transaction事务嵌套时事务提交bug #502

Closed
835718973 opened this issue Oct 26, 2020 · 0 comments
Closed

bug:IFreeSql的Transaction事务嵌套时事务提交bug #502

835718973 opened this issue Oct 26, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@835718973
Copy link

835718973 commented Oct 26, 2020

        [Fact]
        public void Trans()
        {
            g.oracle.Transaction(()=>
            {
                g.oracle.Transaction(() =>
                {
                    g.oracle.Insert(new xxx()).ExecuteAffrows();
                });
                throw new Exception("异常");
            });
        }

使用FreeSql的Transaction事务做嵌套时,当内层事务提交时,整个事务就被提交了,当嵌套外层的事务发生异常,事务也已经无法回滚,Ado在BeginTransaction开启事务时判断了同线程是否已开启事务,已开启事务的会使用同一事务,但是当CommitTransaction事务提交时,没有对外层是否还有嵌套事务做判断,直接将当前事务提交了。
期望:只有最外层事务提交时,整个事务才提交

2881099 added a commit that referenced this issue Oct 26, 2020
@luoyunchong luoyunchong added the bug Something isn't working label Oct 26, 2020
2881099 added a commit that referenced this issue Nov 24, 2020
@2881099 2881099 closed this as completed Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants