简体   繁体   English

事务管理超时问题

[英]Transaction Management time out issue

I am trying to run a query from our application through springs 2.5 and hibernate 3,But query is neither timed out nor returning results (query hangs out),When I run the same query from the query browser it is working fine. 我正在尝试通过Spring 2.5和Hibernate 3在我们的应用程序中运行查询,但是查询既不超时也不返回结果(查询挂起),当我从查询浏览器运行相同的查询时,它运行良好。

Even though I increased query timeout still I am not able to fetch the result. 即使我增加了查询超时,我仍然无法获取结果。

I tried to increase query execution timeout it failed to return records 我试图增加查询执行超时,它无法返回记录

<property name="javax.persistence.query.timeout" value="3000" />

<tx:advice id="defaultTxAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <!-- Keep SequenceService in a isolation transaction -->
        <tx:method name="get*" read-only="true" />
        <!-- By default, A runtime exception will rollback transaction. -->
        <tx:method name="*" timeout="100" rollback-for="ApplicationException" />
    </tx:attributes>
</tx:advice>

Any kind of help/suggestion would be greatly appreciated 任何形式的帮助/建议将不胜感激

These are my thoughts about the issue here.Since i don't find any relevant codes here.. 这些是我对此问题的想法。由于我在这里找不到任何相关代码。

  1. Due to execution of multiple queries in single fetch (issues like n+1 issue in hibernate). 由于在一次抓取中执行了多个查询(在休眠状态下会出现n + 1等问题)。 Hint : Make sure that you set show SQL value as true in developer machine 提示确保在开发人员计算机中将show SQL值设置为true
  2. Due to irregular handling of queries in code, like if you are iterating for n number of time. 由于对代码中查询的不规则处理,例如您要迭代n次。 The Database server will consider its as some threat and it moves to a lock state and stop execution of queries for some time period. 数据库服务器会将其视为某种威胁,并且会进入锁定状态并在一段时间内停止执行查询。
  3. Improper handling of transaction time-out, Like if you are increasing a transaction time-out value then it will probably lock the database for a long time. 事务超时处理不当,就像您要增加事务超时值一样,它可能会长时间锁定数据库。

There are also other possibilities, but i cant make any suggestions unless i see the code. 还有其他可能性,但是除非看到代码,否则我无法提出任何建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM