1

当我检查我的日志时,我使用休眠作为 ORM (catalina.out)

我多次收到此警告

WARN   (org.hibernate.jdbc.JDBCContext:333) - afterTransactionCompletion() was never called

谁能帮我解决这个警告......?

该警告的含义是什么以及何时发生?

4

1 回答 1

2

在文件 JDBCContext.java 源文件中是以下注释

/**
 * We cannot rely upon this method being called! It is only
 * called if we are using Hibernate Transaction API.
 */

这意味着,方法 afterTransactionCompletion() 通常由休眠事务 API 调用,例如 Session.flush() 或 Transaction.commit()。似乎在您的程序中的某个地方可能会发生事务没有定期结束。我们不能告诉你在哪里,因为我们不知道你的代码。

于 2012-09-26T11:40:19.340 回答