SQL トランザクションを MySQL にコミットしようとしていますが、MySQLSyntaxErrorException
.
私が使用しているコードは次のとおりです。
implicit connection =>
SQL("""
start transaction;
insert into projects(id_user, name, description) values({idUser}, {name}, {description});
set @last_id = last_insert_id();
insert into assigned(id_user, id_project) values({idUser}, @last_id);
commit;
""")
.on('idUser -> idUser,
'name -> project.name,
'description -> project.description
).execute()
私が得る例外:
[MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert into projects(id_user, name, description) values(1, 'First inserted proje' at line 1]
Anorm ではそのようなステートメントをまったく実行できないと思い始めています。