在学习hibernate的乐观锁,编写demo的时候出现了错误,报错的主要信息如下:
Caused by: java.sql.SQLSyntaxErrorException: 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 'lock lock0_ where lock0_.id=1' at line 1
本人出错在于数据库表名使用了lock这个名字导致出现了这个异常,改一下数据库的表名即可