我有一个spring批处理程序,它成功地启动了一些作业,这些作业试图使用HibernateItemWriter将数据写入SQL数据库。但是,hibernate代码会失败,因为事务从未启动:
org.hibernate.HibernateException: contains is not valid without active transaction我配置了一个HibernateTransactionManager,我认为它应该处理这个问题,但问题仍然存在。也许我的spring batch配置还在关闭?以下是配置
我在我的项目中遇到了一个问题,我尝试不使用hibernate.cfg.xml文件来配置hibernate,我这样做: System.out.println(username); // Create the SessionFactory// Make sure you log the exception,