我在WebSphere 7.0.0.21上布置了MDB(MDB)信息,通过SIB(服务整合巴士)队列发送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();
我有大约20个MDB的例子。当我向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..
如果我多次增加 Quue 连接工厂的连接池大小, 错误会发生得更少, 但还是存在。 如果我降低 Quue 连接工厂的连接池大小, 错误会经常发生 。
如何关闭连接? 如果连接池的大小大于同时运行的MDB:s, 如何关闭连接?
连接池有各种属性, 但我找不到任何连接关闭功能... 我的代码绝对不关闭任何连接( 除了 ) ) 。