org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode

不打扰是莪最后的温柔 提交于 2019-11-29 16:06:22
atrain

Since you have defined your Spring transactions via @Transactional, you are by default running inside of an auto-commit transaction. As per this other thread, you need to create a second session factory which runs in autocommit = false to retrieve the file.

Additionally, the DAO for the retrieval should be annotated with @Qualifier so that it knows which session factory to use. Example:

@Autowired
public MyDAOImpl(@Qualifier("someSessionFactory") SessionFactory sessionFactory) {
   setSessionFactory(sessionFactory);
}   
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!