|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SessionBean sending JMS messages |
« View previous topic :: View next topic » |
Author |
Message
|
wmq_guy |
Posted: Sun Mar 06, 2005 6:56 pm Post subject: SessionBean sending JMS messages |
|
|
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 |
|
 |
fjb_saper |
Posted: Sun Mar 06, 2005 7:13 pm Post subject: |
|
|
 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 |
|
 |
wmq_guy |
Posted: Sun Mar 06, 2005 7:30 pm Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Mar 07, 2005 10:38 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|