|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
session closed while sending large number of msgs to mq qeue |
« View previous topic :: View next topic » |
Author |
Message
|
sanaullahtech |
Posted: Fri Oct 01, 2010 3:05 am Post subject: session closed while sending large number of msgs to mq qeue |
|
|
Newbie
Joined: 01 Oct 2010 Posts: 1
|
Hi,
I am using WPS6.2.0.3, MQ Series 7.0 and trying to send messages to certain queues using connection factory jndi. The probelm is while sending certain number of messages to queue my session got close. Below is the exception being faced:
J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource JMS$AXIS_CF$JMSManagedConnection@276303992@33. The exception which was received is javax.jms.IllegalStateException: MQJMS1024: session closed
Below is the code i am using to write messages on mQ Queue:
Code: |
Connection con=null;
InitialContext ic;
ic = new InitialContext();
ds = (javax.sql.DataSource) ic.lookup(jndi);
con = ds.getConnection(userName, password);
System.out.println("Connection got");
ConnectionFactory s = (javax.jms.ConnectionFactory) ic.lookup("AXIS_CF");
Q = (javax.jms.Queue) ic.lookup(queueName);
conn = s.createConnection();
conn.start();
session = conn.createSession(true,Session.AUTO_ACKNOWLEDGE);
while(records < 10000){
MessageProducer producer = session.createProducer(Q);
TextMessage message = session.createTextMessage();
message.setText(xml);
producer.send(message);
records++;
}
|
Please help why session is being closed after certain messages. Thanks in advance[/code] |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Fri Oct 01, 2010 4:17 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
I'd start by looking at why you create all those messageproducers and then i'd wander why they are not closed.
And then i'd ask the same question about why the other resources you use arent closed. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 01, 2010 5:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
And then there's whole question of "where's the transaction boundary?". |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Oct 01, 2010 8:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
No error handling
No transaction boundary handling... a default of 10,000 msgs in a tran is too much as it leaves no other tran available (default max qmgr = 10,000)
No releasing of resources acquired....
Review your code, think about it, fix it and come back.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|