我已经在谷歌上搜索并查看了StackOverflow上所有现有的答案,以查找我看到的错误。我试着应用所有的建议,但仍然不能摆脱这个可怕的错误 Caused by: org.hibernate.HibernateException: Could not obtain transaction-synchronizedSpringboot2.2.9和spring data jpa。我正在使用SessionFactory的</em
我正在将一个应用程序从Spring 3.2迁移到Spring 5。该应用程序使用AWS RDS,主数据库作为主数据源,副本数据库作为只读数据源。应用程序为主数据源创建一个会话工厂( primarySessionFacotry)实例,为只读数据源创建另一个会话工厂( readOnlySessionFactory)实例,以便通过连接每个会话工厂,可以对这两个数据源使用相同的org.hibernate.HibernateException: Could not obtain
我希望我的read方法不使用事务,因为这根本不需要,我只使用@ transaction标记创建/更新方法。但我该怎么做?我有一个非常基本的Spring配置等等..。在我的DAO中注入了SessionFactory,在每种方法中我都调用了sessionFactory.getCurrentSession().doQueryStuff();org.hibernate.HibernateExceptionSession bound to t