【发布时间】:2011-01-07 02:24:03
【问题描述】:
在 JUnit 中运行时,我无法使用 Hibernate 和 MySQL 启动事务。我收到一个 HibernateException,它指出:“没有指定 TransactionManagerLookup”。我相信这个错误是因为我没有正确的 hibernate.transaction.manager_lookup_class 配置设置。
我看到在 org.hibernate.transaction 的命名空间下,我可以使用很多不同的查找类。我能找到的关于这些的所有文档都非常模糊。我的问题是什么是适合 MySQL 的?
【问题讨论】:
-
请在测试环境中显示您的配置。在容器外运行时,您通常不使用 JEE 事务管理器(所以不,
hibernate.transaction.manager_lookup_class在测试上下文中不是必需的)。
标签: java mysql hibernate configuration transactions