delaying identity-insert due to no transaction in progress

泪湿孤枕 提交于 2019-12-25 00:09:14

问题


use Service layer to persist data into database. But the Unit Test does not have this problem. I turn on debug and check the log file carefully. In the place where data should inert into database, I find the information: "delaying identity-insert due to no transaction in progress"


回答1:


the issue was due to @Transaction and @Autowire

my generic dao was autowired and when we @Transaction it is unable to wrap my service class by transaction proxy class thus .It executes without saving data and without giving any error except the message as "delaying identity-insert due to no transaction in progress".

I removed the autowire and injected manually the genric dao object and it starts working.



来源:https://stackoverflow.com/questions/9774384/delaying-identity-insert-due-to-no-transaction-in-progress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!