@@ -0,0 +1,3809 @@
+/*%0A * Copyright 2015-2021 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,%0A * either express or implied. See the License for the specific language%0A * governing permissions and limitations under the License.%0A */%0Apackage org.docksidestage.mysql.dbflute.vendor;%0A%0Aimport javax.annotation.Resource;%0A%0Aimport org.dbflute.utflute.core.cannonball.CannonballOption;%0Aimport org.dbflute.utflute.core.transaction.TransactionResource;%0Aimport org.docksidestage.mysql.dbflute.exbhv.MemberBhv;%0Aimport org.docksidestage.mysql.dbflute.exentity.Member;%0Aimport org.docksidestage.mysql.unit.UnitContainerTestCase;%0A%0A/**%0A * @author jflute%0A * @since DBFlute-1.2.5 (2021/11/17 Wednesday)%0A */%0Apublic class VendorTxIsolationTest extends UnitContainerTestCase %7B%0A%0A    // ===================================================================================%0A    //                                                                           Attribute%0A    //                                                                           =========%0A    @Resource%0A    private MemberBhv memberBhv;%0A%0A    // ===================================================================================%0A    //                                                                      Table Snapshot%0A    //                                                                      ==============%0A    public void test_RepeatableRead_tableSnapshot() %7B%0A        Member beforeFirst = memberBhv.selectByPK(1).get();%0A        Member beforeNinth = memberBhv.selectByPK(9).get();%0A        log(beforeFirst);%0A        log(beforeNinth);%0A        assertNotSame(%22sea%22, beforeNinth.getMemberName());%0A        try %7B%0A            cannonball(car -%3E %7B%0A                adjustTransactionIsolationLevel_RepeatableRead();%0A%0A                car.projectA(dragon -%3E %7B%0A                    Member member = memberBhv.selectByPK(1).get();%0A                    log(member.getMemberName());%0A                %7D, 1);%0A                car.projectA(dragon -%3E %7B%0A                    TransactionResource resource = xgetTestCaseTransactionResource();%0A                    Member member = new Member();%0A                    member.setMemberId(9);%0A                    member.setMemberName(%22sea%22);%0A                    memberBhv.updateNonstrict(member);%0A                    commitTransaction(resource);%0A                %7D, 2);%0A%0A                car.projectA(dragon -%3E %7B%0A                    // table snapshot so old data selected%0A                    Member member = memberBhv.selectByPK(9).get();%0A                    log(member.getMemberName());%0A                    log(%22first ninth: %7B%7D%22, member.getMemberName());%0A                    assertEquals(beforeNinth.getMemberName(), member.getMemberName());%0A                %7D, 1);%0A                car.projectA(dragon -%3E %7B%0A                    // no snapshot so new data selected%0A                    Member member = memberBhv.selectByPK(9).get();%0A                    log(%22third ninth: %7B%7D%22, member.getMemberName());%0A                    assertEquals(%22sea%22, member.getMemberName());%0A                %7D, 3);%0A            %7D, new CannonballOption().threadCount(3));%0A        %7D finally %7B // rollback%0A            performNewTransaction(() -%3E %7B%0A                Member member = memberBhv.selectByPK(9).get();%0A                member.setMemberName(beforeNinth.getMemberName());%0A                memberBhv.updateNonstrict(member);%0A                return true; // commit%0A            %7D);%0A        %7D%0A    %7D%0A%7D%0A

make test_RepeatableRead_tableSnapshot() for MySQL