summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2008-04-23 14:07:16 +0000
committerRobert Godfrey <rgodfrey@apache.org>2008-04-23 14:07:16 +0000
commitc4f417d0ed561b10a05fbd6d75cf4d04f46ad42c (patch)
tree1306e1bb2c5499e24de08df7f36dbf9921f893c8
parent7537ab11b02d280a5ca6a4c50d7a98f7fcb69e38 (diff)
downloadqpid-python-c4f417d0ed561b10a05fbd6d75cf4d04f46ad42c.tar.gz
QPID-832 : connection should be set to started before sessions are started
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/thegreatmerge@650876 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
index f6537e0375..3969eef8a9 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
@@ -227,7 +227,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
* Whether this connection is started, i.e. whether messages are flowing to consumers. It has no meaning for message
* publication.
*/
- protected boolean _started;
+ protected volatile boolean _started;
/** Policy dictating how to failover */
protected FailoverPolicy _failoverPolicy;
@@ -862,6 +862,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
checkNotClosed();
if (!_started)
{
+ _started = true;
final Iterator it = _sessions.values().iterator();
while (it.hasNext())
{
@@ -876,7 +877,7 @@ public class AMQConnection extends Closeable implements Connection, QueueConnect
}
}
- _started = true;
+
}
}