我们最近从 2.0.3 升级了我们的应用程序,有时会遇到执行查询的问题。我们需要获取要在 UI 中显示的记录列表以及列表的总计数以显示分页。在这两个地方,我们都使用 executeQuery 方法来获取数据。在获取数据时我们没有任何问题,但是在获取合格记录的总数时,JVM 崩溃并且应用程序被挂起。如果不重新启动服务器和机器上运行的服务,我们将无法继续进行。
这是我们用来获取计数的查询:
select count(camp) from Campaign as camp
where ( camp.domainId=-1 AND (camp.status not in ('X')) )
AND camp.campaignType IN ('B','I') order by camp.startDate desc
我们在 2.0.3 中使用相同的查询,从未遇到任何问题。升级到 2.2.4 后,我们遇到了这个问题,这个问题并不一致。这是崩溃后的日志:
A fatal error has been detected by the Java Runtime Environment:
Internal Error (javaCalls.cpp:59), pid=6236, tid=5144
guarantee(thread->is_Java_thread()) failed: crucial check - the VM thread cannot and must not escape to Java code
JRE version: 7.0-b147
Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0-b17 mixed mode windows-amd64 compressed oops)
Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+3
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
cmlui.CMLCampaignService.getCampaignCount(Ljava/lang/Object;ZLcmlui/GUIUser;Z)Ljava/lang/Object;+570
cmlui.CMLCampaignService.getCampaignCount(Ljava/lang/Object;ZLcmlui/GUIUser;)Ljava/lang/Object;+121
cmlui.CMLCampaignService$$FastClassByCGLIB$$f623839b.invoke(ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+2937
net.sf.cglib.proxy.MethodProxy.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+19
org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint()Ljava/lang/Object;+24
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;+19
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object;+87
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;+101
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;Lnet/sf/cglib/proxy/MethodProxy;)Ljava/lang/Object;+112
cmlui.CMLCampaignService$$EnhancerByCGLIB$$69c262f0.getCampaignCount(Ljava/lang/Object;ZLcmlui/GUIUser;)Ljava/lang/Object;+349
cmlui.CMLCampaignService$getCampaignCount.call(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+122