Q: why the sqlsession transaction not working in mybatis? I am using sqlsession to do a transaction like this(MySQL v5.7.26):
         @Override
            public WalletLockedRecord lock(UserLockInfo userLockInfo) {
                // open transaction
                SqlSession sqlSession = sqlSessionFactory.openSession(false);
                try {
                    // do something in this place
                    WalletRecordMapper recordMapper = sqlSession.getMapper(WalletRecordMapper.class);
                    Integer result = recordMapper.updateByPrimaryKey(walletRecord);

                    WalletLockedRecord lockedRecord = new WalletLockedRecord();
                    lockedRecord.setLockedAmount(userLockInfo.getAmount());
                    lockedRecord.setAppId(userLockInfo.getAppId());
                    lockedRecord.setLockedType(userLockInfo.getLockedType().name());
                    lockedRecord.setRoomPlayId(userLockInfo.getRoomPlayId());
                    lockedRecord.setUserId(userLockInfo.getUserId());
                    lockedRecord.setLockedKey(UUID.randomUUID().toString());
                    lockedRecord.setBizId(userLockInfo.getBizId());
                    WalletLockedRecordMapper lockedRecordMapper = sqlSession.getMapper(WalletLockedRecordMapper.class);
                    lockedRecordMapper.insertSelective(lockedRecord);
                    // insert record failed in this place and throw exception
                    lockRecordHostory(lockedRecord, WalletLockedOperateType.LOCKED,sqlSession);

                    sqlSession.commit();
                    return lockedRecord;
                } finally {
                    if (sqlSession != null) {
                        sqlSession.close();
                    }
                }
            }

The question is: the update did not rollback when exception throw in lockRecordHostory function,why the transaction not working,I am using the same sqlsession.
