在我的应用程序中,我在dao层使用Spring 4.0声明式事务管理和hibernate ...我使用hibernate模板进行插入和更新。 ..因为我必须插入大量的记录,我在hibernate模板上调用了flush和clear方法。每50条记录之后。但我所观察到的是它在处理时锁定了特定的表。 ..只有在db中插入所有记录后我才能在db上触发查询... 这种行为是否正确???它有没有适当的解决方案
答案 0 :(得分:0)
尝试将以下数据源属性添加到数据源配置中。
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="10000"></property>
同时检查this。 希望这会有所帮助。