【问题标题】:Hibernate Eager select hangs in "Idle in transaction"Hibernate Eager select 挂在“Idle in transaction”中
【发布时间】:2014-04-01 13:55:54
【问题描述】:

在我的项目中,我使用的是休眠 3、Spring 和 C3p0,在咨询了 postgres 的 pg_stat_activity 之后,我强烈怀疑此查询来自休眠查询,用于在我的一个实体中填充 EAGER 列表

select listrulesf0_.rule_block_register_id as rule4_15_1_, listrulesf0_.id as id1_16_1_, listrulesf0_.id as id1_16_0_, listrulesf0_.display_order as display2_16_0_, listrulesf0_.id_field as id3_16_0_, listrulesf0_.rule_block_register_id as rule4_16_0_ from (...)

此查询在事务中挂起空闲,有效地阻塞了我程序中的所有其他操作。

我不知道这是怎么发生的以及我该如何解决它。

【问题讨论】:

标签: java hibernate c3p0


【解决方案1】:

原来不是 EAGER 选择,而是紧随其后的刷新

IDLE in transaction when using entity manager flush

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-31
    • 2011-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-09
    • 1970-01-01
    相关资源
    最近更新 更多