0

データベースコンポーネントでミュールによって提供される接続プーリングを使用しています。巨大な負荷をかけたときにエラーを下回っています。

パラメータを maxConnection=100、minConn=0、autoIncrement =15、waitMillisec=10000 として設定し、準備済みステートメントのキャッシュ サイズをデフォルトのままにしました (つまり、何も設定しませんでした)。以下を再愛用するために、これを手伝っていただけませんか。

{"timestamp":"2016-10-22T09:28:13,611","level":"WARN","thread":"ActiveMQ Session Task-25","loggerName":"com.mchange.v2.c3p0.impl.NewPooledConnection","message":"[c3p0] A PooledConnection that has already signalled a Connection error is still in use!"}    
{"timestamp":"2016-10-22T09:28:13,611","level":"WARN","thread":"ActiveMQ Session Task-25","loggerName":"com.mchange.v2.c3p0.impl.NewPooledConnection","message":"[c3p0] Another error has occurred [ java.sql.SQLException: A problem occurred while trying to acquire a cached PreparedStatement in a background thread. ] which will not be reported to listeners!"}
    java.sql.SQLException: A problem occurred while trying to acquire a cached PreparedStatement in a background thread.
        at com.mchange.v2.c3p0.stmt.GooGooStatementCache.acquireStatement(GooGooStatementCache.java:571) ~[?:?]
        at com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkoutStatement(GooGooStatementCache.java:204) ~[?:?]
        at com.mchange.v2.c3p0.impl.NewPooledConnection.checkoutStatement(NewPooledConnection.java:321) ~[?:?]
        at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:455) ~[?:?]
        at org.mule.module.db.internal.domain.connection.DefaultDbConnection.prepareStatement(DefaultDbConnection.java:52) ~[?:?]
        at org.mule.module.db.internal.domain.autogeneratedkey.NoAutoGeneratedKeyStrategy.prepareStatement(NoAutoGeneratedKeyStrategy.java:34) ~[?:?]
        at org.mule.module.db.internal.domain.statement.QueryStatementFactory.create(QueryStatementFactory.java:59) ~[?:?]
        at org.mule.module.db.internal.domain.executor.AbstractSingleQueryExecutor.execute(AbstractSingleQueryExecutor.java:44) ~[?:?]
        at org.mule.module.db.internal.processor.UpdateMessageProcessor.doExecuteQuery(UpdateMessageProcessor.java:59) ~[?:?]
        at org.mule.module.db.internal.processor.AbstractSingleQueryDbMessageProcessor.executeQuery(AbstractSingleQueryDbMessageProcessor.java:42) ~[?:?]
        at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:66) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:98) ~[?:?]
        at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:55) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:98) ~[?:?]
        at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58) ~[?:?]
        at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:98) ~[?:?]
        at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:41) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:98) ~[?:?]
        at org.mule.processor.AbstractRequestResponseMessageProcessor.processBlocking(AbstractRequestResponseMessageProcessor.java:56) ~[?:?]
        at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) ~[?:?]
        at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) ~[?:?]
        at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61) ~[?:?]
        at org.mule.construct.AbstractPipeline$3.process(AbstractPipeline.java:231) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.chain.SimpleMessageProcessorChain.doProcess(SimpleMessageProcessorChain.java:43) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50) ~[?:?]
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66) ~[?:?]
        at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[?:?]
        at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[?:?]
        at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[?:?]
        at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61) ~[?:?]
        at org.mule.transport.AbstractMessageReceiver.routeEvent(AbstractMessageReceiver.java:511) ~[?:?]
        at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:226) ~[?:?]
        at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:208) ~[?:?]
        at org.mule.transport.AbstractReceiverWorker$1$1.process(AbstractReceiverWorker.java:145) ~[?:?]
        at org.mule.transport.AbstractReceiverWorker$1$1.process(AbstractReceiverWorker.java:113) ~[?:?]
        at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) ~[?:?]
        at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35) ~[?:?]
        at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22) ~[?:?]
        at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) ~[?:?]
        at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) ~[?:?]
        at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) ~[?:?]
        at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) ~[?:?]
        at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) ~[?:?]
        at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) ~[?:?]
        at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) ~[?:?]
        at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) ~[?:?]
        at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) ~[?:?]
        at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) ~[?:?]
        at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110) ~[?:?]
        at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30) ~[?:?]
        at org.mule.transport.AbstractReceiverWorker$1.process(AbstractReceiverWorker.java:112) ~[?:?]
        at org.mule.transport.AbstractReceiverWorker$1.process(AbstractReceiverWorker.java:96) ~[?:?]
        at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) ~[?:?]
        at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) ~[?:?]
        at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) ~[?:?]
        at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) ~[?:?]
        at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) ~[?:?]
        at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) ~[?:?]
        at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) ~[?:?]
        at org.mule.execution.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:65) ~[?:?]
        at org.mule.transport.AbstractReceiverWorker.processMessages(AbstractReceiverWorker.java:179) ~[?:?]
        at org.mule.transport.jms.MultiConsumerJmsMessageReceiver$SubReceiver.onMessage(MultiConsumerJmsMessageReceiver.java:439) ~[?:?]
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1394) ~[?:?]
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) ~[?:?]
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) ~[?:?]
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) ~[?:?]
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_73]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_73]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170) ~[?:?]
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:304) ~[?:?]
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:1863) ~[?:?]
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:1566) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
        at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
        at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:546) ~[?:?]
        at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) ~[?:?]
4

3 に答える 3

2

わかった。

ステートメント キャッシングを使用している場合、c3p0 は、キャッシュされた適切なステートメントが接続で使用できない場合、キャッシュ用のステートメントを非同期的に取得します。負荷が高く、構成を慎重に行わないと、サーバーでの輻輳または c3p0 のスレッド プールの輻輳が原因で、この非同期取得に長い時間がかかる可能性があります。ステートメントを取得しようとするクライアントは、ステートメントが正常に取得されるか、例外が発生するまで無期限に待機します。

根本原因の Exception (スタック トレースの一番下の方) から、長い可能性があるステートメントの取得が発生している間に、ステートメントの取得元である接続が close() されたか、停止したことは明らかです。これを本当に理解するには、これをデバッグする必要があります。考えられる原因は次のとおりです。

  1. これらの条件下では、負荷/ネットワークの問題/謎のグレムリンによって接続が破損し、接続が無効になり、close() されることがあります。
  2. DBMS または一部の管理ウォッチャーは、これらの (おそらく長時間ハングした) 接続を閉じます。これは、開いている接続が多すぎるか、開いている時間が長すぎるためです。(おそらく、これはデッドロック検出機能の働きです。)
  3. あなたのアプリケーションは (賢明ではありませんが) 複数のスレッドで接続を使用します。そのうちの 1 つは close() を呼び出しますが、もう 1 つはステートメントでまだ wait() しています。その後、プールは (いくつかの理由のいずれかで) チェックインされた接続を close() しようと試み、このエラーが発生します。

(3)の場合はやめたほうがいいのですが、それが一番可能性が低いと思います。(1) または (2) の場合、問題を軽減できる主な方法は、Statement の取得が高速であることを確認することです。これにより、Statement を wait() している間に悪いことが起こりにくくなります。

最初に確認するのは、アプリケーションが受ける負荷条件下での c3p0 のスレッド プールです。それは追いついていますか?(これは、JMX を介して、またはgetThreadPoolNumTasksPending()のような PooledDataSource メソッドへの呼び出しを介して確認できます。または、最も簡単な方法は、単純に c3p0 config param numHelperThreadsをスケールアップすることです。そのため、Statement 取得などのタスクがバックログされる可能性は低くなります。

本当に役立つもう 1 つの構成変更は、チャーンを防ぐために十分な数のステートメントをキャッシュできるようにすることです (ステートメント キャッシュ内の接続を常に close() して再取得します)。非常によくある構成ミスは、グローバルなmaxStatements構成パラメーターを低すぎる値に設定することです。これを正しく行う簡単な方法は、グローバル制限ではなくmaxStatementsPerConnectionを使用し、これをアプリケーションで頻繁に使用される PreparedStatements のおおよその数に設定することです。

何が起こっているのかを本当に理解するには、どのような種類のタスクが未処理になっているのかを確認する必要があります。PooledDataSource.sampleThreadPoolStatus()をコード内で直接または JMX 経由で再度使用します。

更新:元の投稿では、「準備されたステートメントキャッシュのサイズはデフォルトのままです」と述べています。これはミュールのデフォルトかもしれませんが、c3p0 のデフォルトでは、Statement キャッシングはまったく使用されませmaxStatements=0maxStatementsPerConnection=0。あなたの設定は、あなたが思っているものではないかもしれません。ステートメントのキャッシュを無効にすることは、この問題を解決するための非常に簡単な方法かもしれません。

于 2016-10-27T00:03:16.417 に答える