Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2857A998B for ; Tue, 14 Feb 2012 17:56:21 +0000 (UTC) Received: (qmail 34320 invoked by uid 500); 14 Feb 2012 17:56:21 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 34280 invoked by uid 500); 14 Feb 2012 17:56:20 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 34270 invoked by uid 99); 14 Feb 2012 17:56:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2012 17:56:20 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,SUBJ_OBFU_PUNCT_FEW,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of martin@attivio.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2012 17:56:14 +0000 Received: from joe.nabble.com ([192.168.236.139]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RxMbZ-0001ny-I4 for dev@activemq.apache.org; Tue, 14 Feb 2012 09:55:53 -0800 Date: Tue, 14 Feb 2012 09:55:53 -0800 (PST) From: mserrano To: dev@activemq.apache.org Message-ID: <1329242153547-4387875.post@n4.nabble.com> Subject: are session.commit() and consumer.receive allowed simultaneously in separate threads? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org >From the reading I have done on this list and the documentation, I have come to the conclusion that if I: * Need to call session.commit() or message.acknowledge() in one thread * And need to called consumer.receiveNoWait() in another thread (consumer was created from the session). That I need to guard the session against multithreaded access. So I am currently doing: and Is the synchronization on the consumer actually required? I would prefer to call one of the consumer blocking calls rather than receiveNoWait(), but cannot allow the session synchronization to be held that long. -- View this message in context: http://activemq.2283324.n4.nabble.com/are-session-commit-and-consumer-receive-allowed-simultaneously-in-separate-threads-tp4387875p4387875.html Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.