アスペクト プロセスに問題があります。アスペクトにラッピングしたクオーツジョブウィッチを予定しております。アスペクトなしで行うと問題はありませんが、プロセスを数回実行した後にアスペクトでラップすると、データベースに接続しようとしてアプリケーションがハング状態になるようです。ログには、ConnectionWaitTimeoutExceptions によるいくつかの J2CA0045E エラーと、プールから空き接続を取得する際の問題に関するその他のエラーが示されています。無料の接続を探しても、利用できるものはありません。私の側面が接続を閉じていないようです。アスペクトを使用しないとすべてがうまくいき、接続が閉じられるため、なぜこれが起こっているのかわかりません。
applicationContext.xml での私のアスペクト構成は次のようになります。
<!-- Aspect -->
<bean id="logAspect" class="hr.kket.cscada.web.util.aspect.LoggingAspect" />
<aop:config proxy-target-class="true">
<aop:aspect id="aspectLoggging" ref="logAspect" >
<aop:pointcut id="syncUdwAspect"
expression="execution(* hr.kket.cscada.services.balancing.BalancingService.syncAllUdwForGasDay(..))" />
<!-- @Around -->
<aop:around method="logProcess" pointcut-ref="syncUdwAspect" />
</aop:aspect>
</aop:config>
私の loggingAspect クラスは次のようになります:
@Aspect
public class LoggingAspect {
public Object logProcess(ProceedingJoinPoint joinPoint) throws Throwable {
<!-- some code before -->
int br = dbparameter;//
if(br == 0) {
log.error('some message');
} else {
insertSomethingInDB();//inside I open and close connection, this works well.
try {
Object result = joinPoint.proceed();// connection of this job is not closing with aspect
<!-- some code after -->
insertSomethingInDB();//inside I open and close connection, this works well.
return result;
} catch (Exception e) {
log.info(e.getMessage());
<!-- some code here -->
throw e;
}
}
return null;
}
}
何が問題なのか誰か知っていますか?前もって感謝します!