[ openjms-Bugs-697411 ] Server blocks with TCP connecter if an error occur
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.java.openjms.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #697411, was opened at 2003-03-04 18:38 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=474136&aid=697411&group_id=54559 Category: server Group: v0.7.4 >Status: Closed >Resolution: Invalid Priority: 9 Submitted By: Lorenzo Scantamburlo (orentz) Assigned to: Jim Alateras (jalateras) Summary: Server blocks with TCP connecter if an error occur Initial Comment: The server OpenJMS blocks if an error occur notifing messages, all clients block if you close the client that generated the situation all works again. ---------------------------------------------------------------------- >Comment By: Tim Anderson (tanderson) Date: 2003-03-31 13:57 Message: Logged In: YES user_id=557161 This problem was being caused by a sender and receiver each accessing a session simultaneously from separate threads. The resources of a Session can only be accessed from a single thread of control (see reference below). You need to construct 2 sessions, one for the sender, and one for the receiver, to ensure that there is only a single thread of control. From section 4.4.6 of the spec, "Conventions for Using a Session" "Sessions are designed for serial use by one thread at a time. The only exception to this occurs during the orderly shutdown of the session or its connection. See Section 4.3.5, "Closing a Connection" and Section 4.4.1, "Closing a Session" for further details. One typical use is to have a thread block on a synchronous MessageConsumer until a message arrives. The thread may then use one or more of the sessions MessageProducers. It is erroneous for a client to use a thread of control to attempt to synchronously receive a message if there is already a client thread of control waiting to receive a message in the same session. Another typical use is to have one thread set up a session by creating its producers and one or more asynchronous consumers. In this case, the message producers are exclusively for the use of the consumers message listeners. Since the session serializes execution of its consumers MessageListeners, they can safely share the resources of their session." ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=474136&aid=697411&group_id=54559