小编Vir*_*raj的帖子

在执行大量查询时回滚事务(JBoss 5.1)

我在执行大量查询时遇到问题.

我需要在单个事务中执行超过10,000个本机SQL查询.这些查询是动态生成的,并在系统中缓存.在完成查询生成之后,在单个事务中逐个发送并执行这些查询.该应用程序是使用EJB 3开发的,它在JBoss 5.1上运行.

如果查询数小于7200(近似值),应用程序可以正常工作.但是如果查询多于此,则抛出该方法并抛出EJB异常并回滚事务.没有数据持续存在.

这是回滚发生的地方.[仅当查询数量超过7200时]

 @TransactionAttribute(TransactionAttributeType.REQUIRED)
 public void confirmOrder(String[] queries) {
    for (int i = 0; i < queries.length; i++) {
        em.createNativeQuery(queries[i]).executeUpdate();        //line # 108
    }
    BigInteger bigInt = (BigInteger)em.createNativeQuery("select max(id) from order_item").getSingleResult();
    return bigInt!=null ? Long.valueOf(bigInt.longValue()) : null;
}
Run Code Online (Sandbox Code Playgroud)

有没有办法增加可以在事务中执行的查询数量?请就此提出建议.

/的Viraj

The following is the error trace.

17:36:33,233 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TransactionReaper_18] - TransactionReaper::check timeout for TX -3f57767b:bc55:4fd9d129:e3a3 in state  RUN
17:36:33,238 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TransactionReaper_7] - TransactionReaper::doCancellations worker Thread[Thread-10,5,jboss] successfully canceled TX -3f57767b:bc55:4fd9d129:e3a3
17:36:33,635 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TransactionReaper_18] - TransactionReaper::check …
Run Code Online (Sandbox Code Playgroud)

transactions exception max jboss5.x

1
推荐指数
2
解决办法
2万
查看次数

标签 统计

exception ×1

jboss5.x ×1

max ×1

transactions ×1