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 » SessionBean sending JMS messages

Post new topic  Reply to topic
 SessionBean sending JMS messages « View previous topic :: View next topic » 
Author Message
wmq_guy
PostPosted: Sun Mar 06, 2005 6:56 pm    Post subject: SessionBean sending JMS messages Reply with quote

Acolyte

Joined: 21 Oct 2004
Posts: 50

using MQ5.3/WAS51

I have a Statelesss SB that puts messages on a queue queue to be sent to a remote system.

I have set the max connections to 10 on the QCF factory it is using. (will changing this soon, but I want to understand what is happening)


***
Do I need to explicitly set close the connection for the queueconnection after the sendMessage() is called even though I have the cleanup in the ejbRemove()?

I am getting a new QCF connection with each call to the sendmsg(), so I guess the container tried to create this each time and it is running out?
even though it is pulling from a pool? Do people put the createQueueConnection in the ejbCreate() instead?

here is the message:

Quote:


[3/4/05 11:13:46:548 EST] 61315440 FreePool E J2CA0045E: Connection not available while invoking method queueRequest for resource jms/SLSB/SLSBqcf001.
[3/4/05 11:13:46:836 EST] 61315440 ConnectionMan E J2CA0020E: The Connection Pool Manager could not allocate a Managed Connection: com.ibm.websphere.ce.j2c.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180007
at com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(FreePool.java:1030)
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Mar 06, 2005 7:13 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

If you have the release resources in the remove, you should have the acquire resources in the post create, put the resources in private variables (remember they must survive a passivate) and use them every time you call a method. Remember that the session should be created and released by each of the threads calling any of the methods accessing the queue.

Enjoy
Back to top
View user's profile Send private message Send e-mail
wmq_guy
PostPosted: Sun Mar 06, 2005 7:30 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Oct 2004
Posts: 50

I currently have it set up as:

Code:

class SessionBeanSender{

private QCF
private Q
private Session
private Qconn
....etc

ejbCreate(){ }

ejbRemove(){

Qconn.close()
}

sendMYMessage()
{

lookupQCF
lookupQ
create connection
create session

create TextMessage("hello")
sendTextMessage

qConn.close
qConn=null
}




}

i recently added the qconn.close at the end , it was only in the ejbRemove..
you are saying add the creations in the ebjCreate() ?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Mar 07, 2005 10:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Yes and remove creation from on message.
The only thing that should be in on Message is the session setup. sender setup, message send , session commit, sender close, session close.

This way you do not waste the overhead of creating a connection everytime.

Enjoy
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 » SessionBean sending JMS messages
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.