[jboss-user] [JBoss Messaging] - Re: Failed to get a server session

imaeses do-not-reply at jboss.com
Fri Mar 30 11:06:35 EDT 2007

Well the solution was breaking the deadlock, which is application specific. As long as the QueueConnection could be reestablished, the deadlock would be broken.

We stopped implementing message receive as a MessageListener and did it ourselves. This had the effect that we could control when receive() was called and how long it would block for. If onException() was called, we could set a flag in the receive thread. The receive thread would eventually return from receive() and close it's QueueSession object. So QueueConnection.close() always works. Then we reestablish the QueueConnection and the deadlock is cleared.

(The deadlock had to do with two threads. Thread A wanted to add a message to a data structure but had to wait() because it was currently full. Thread B wanted to read from this data structure but would first wait() on the same monitor if there was no valid QueueConnection.) 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033224#4033224

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033224

More information about the jboss-user mailing list