yii2 redis add transaction


I am using redis extension with active record to save some data. In a specific case, I want to have a transaction because I want to make sure that in a master detail relationship both active records, master and detail are saved, or not in case of error. I have used the redis transaction mechanism, (multi + exec), but I am getting the following error, "Redis error: ERR Error compiling script (new function): user_script:1: unexpected symbol near ‘,’ " when I call the exec. This is probably due to the conflict of using Redis Lua in active record in Redis which executes in a transaction fashion. Because I am not familiar with lua I am asking if there is any workaround to bypass redis lua error, or should I abandon the active record pattern for this specific case and use native redis commands instead.