User: hiram
Date: 00/11/11 16:29:08
Modified: src/java/org/spydermq SpyConnection.java
Log:
When you closed a connection after sending a message you
would get an exception from the run method of the SpySession.
Problem: The close() method was setting the close flag too prematury.
Revision Changes Path
1.13 +6 -4 spyderMQ/src/java/org/spydermq/SpyConnection.java
Index: SpyConnection.java
===================================================================
RCS file: /products/cvs/ejboss/spyderMQ/src/java/org/spydermq/SpyConnection.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SpyConnection.java 2000/07/07 22:37:21 1.12
+++ SpyConnection.java 2000/11/12 00:29:08 1.13
@@ -31,7 +31,7 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public class SpyConnection
implements Connection, Serializable
@@ -171,7 +171,6 @@
public synchronized void close() throws JMSException
{
if (closed) return;
- closed=true;
//Get an ID / ConnectionReciever
if (distributedConnection==null) createReceiver();
@@ -192,8 +191,11 @@
ConnectionReceiverFactory.close(distributedConnection);
} catch (Exception e) {
failureHandler(e,"Cannot close properly the connection");
- }
-
+ }
+
+ // Only set the closed flag after all the objects that depend
+ // on this connection have been closed.
+ closed=true;
}
//called by a TemporaryDestination which is going to be deleted()