WebSphere 7.0.0.21にデプロイされたメッセージドリブンビーン(MDB)があり、SIB(サービス統合バス)キューでJMSメッセージを送信します。
JMSリソースが作成されます。
@Resource(name = CONN_FACTORY, mappedName = CONN_FACTORY)
private QueueConnectionFactory connFactory;
@PostConstruct
public void postConstruct() {
queueConnection = connFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
responseQueueSender = queueSession.createSender(getResponseQueue());
}
そして破壊された:
@PreDestroy
public void preDestroy() {
responseQueueSender.close();
queueSession.close();
queueConnection.close();
}
このように送信する:
TextMessage responseMessage = queueSession.createTextMessage("message");
responseQueueSender.send(responseMessage, DeliveryMode.PERSISTENT, Message.DEFAULT_PRIORITY, expirationTime);
queueSession.commit();
MDBのインスタンスは約20個あります。MDBへの着信メッセージを大量に生成すると、問題が発生します。次のエラーが発生しました:
CWSIA0053E: An exception was received during the call to the method JmsSessionImpl.getTransaction (#1): javax.resource.spi.IllegalStateException: CWSJR1121E: An internal error has occurred. During the call to the method getManagedConnection the exception javax.resource.spi.ResourceAllocationException: CWSJR1028E: An internal error has occurred. The exception com.ibm.ws.sib.processor.exceptions.SIMPConnectionUnavailableException: CWSIK0022E: The connection is closed to messaging engine seit3022Node01.server1-Payment and cannot be used. was received in method createManagedConnection. was thrown..
キュー接続ファクトリの接続プールサイズを大幅に増やすと、エラーが発生することはめったにありませんが、それでも存在します。プールサイズを小さくすると、エラーが頻繁に発生します。
どうすれば接続を閉じることができますか?同時MDBの数よりも大きい接続プールサイズがある場合、接続を閉じるにはどうすればよいですか?
接続プールにはさまざまなプロパティがありますが、使用中の接続を閉じることに関しては何も見つかりません...そして私のコードは間違いなく接続を閉じません(を除く@PreDestroy
)