ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » session closed while sending large number of msgs to mq qeue

Post new topic  Reply to topic
 session closed while sending large number of msgs to mq qeue « View previous topic :: View next topic » 
Author Message
sanaullahtech
PostPosted: Fri Oct 01, 2010 3:05 am    Post subject: session closed while sending large number of msgs to mq qeue Reply with quote

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
View user's profile Send private message
WMBDEV1
PostPosted: Fri Oct 01, 2010 4:17 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Fri Oct 01, 2010 5:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

And then there's whole question of "where's the transaction boundary?".
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Oct 01, 2010 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » session closed while sending large number of msgs to mq qeue
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.