gpt4 book ai didi

java - JPA 中打开的最大游标

转载 作者:行者123 更新时间:2023-12-01 11:44:03 43 4
gpt4 key购买 nike

下面是我的代码片段。抱歉这么长的代码。但真的不明白为什么会发生这种情况。

    class StartProcessTask implements Callable<ProgramProcesses>{
//constructor and fields


@Override
public ProgramProcesses call() throws Exception {
ProgramProcesses programProcess=null;
try {
EntityTransaction transaction = EntityManagerUtil.getInstance().beginWfTransaction();
EntityTransaction asapTransaction = EntityManagerUtil.getInstance().beginAsapTransaction();

programProcess = programsBusinessLogic.addProgramProcesses(program, instanceId);
Set<ProgramProcesses> programProcesses = new HashSet<ProgramProcesses>();
programProcesses.add(programProcess);
program.setProgramProcesses(programProcesses);
programsDataAccess.updateProgramDetails(program);
EntityManager entityManager = EntityManagerUtil.getInstance().currentWfEntityManager();
entityManager.merge(program);
getProcessInstanceId());
userTransaction.commit();
asapTransaction.commit();
transaction.commit();

} catch (Exception e) {

EntityManagerUtil.getInstance().rollbackWfTransaction();
EntityManagerUtil.getInstance().rollbackAsapTransaction();
throw e;
} finally {
i
EntityManagerUtil.getInstance().closeAsapEntityManager();
EntityManagerUtil.getInstance().closeWfEntityManager();
}
return programProcess;
}

}

}

我调用合并函数的地方失败了。错误为

javax.persistence.QueryTimeoutException: ORA-01000: maximum open cursors exceeded.

我尝试关闭结果集,但没有成功。有人可以帮我解决这个问题吗?

最佳答案

检查 Oracle 上打开的游标数量。例如这个查询

SELECT  max(a.value) as highest_open_cur, p.value as max_open_cur FROM v$sesstat a, v$statname b, v$parameter p WHERE  a.statistic# = b.statistic#  and b.name = 'opened cursors current' and p.name= 'open_cursors' group by p.value;

为您提供 session 之间打开游标的最大数量,以及 oracle 实例允许的最大打开游标数量。也许您需要增加该金额。

关于java - JPA 中打开的最大游标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29304642/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com