Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 48535 invoked from network); 23 Aug 2010 14:20:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Aug 2010 14:20:12 -0000 Received: (qmail 94563 invoked by uid 500); 23 Aug 2010 14:20:12 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 94354 invoked by uid 500); 23 Aug 2010 14:20:10 -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 94331 invoked by uid 99); 23 Aug 2010 14:20:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 14:20:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 14:20:08 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7NEJlFS007028 for ; Mon, 23 Aug 2010 14:19:48 GMT Message-ID: <1991794.12501282573187637.JavaMail.jira@thor> Date: Mon, 23 Aug 2010 10:19:47 -0400 (EDT) From: "Michel Van Hoof (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQNET-275) Session throws not in transaction error when no message has been received during transactional session In-Reply-To: <1732217.12481282573067317.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/AMQNET-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michel Van Hoof updated AMQNET-275: ----------------------------------- Description: When trying to upgrade the NMS libraries in the MassTransit, i noticed i started receiving exceptions: {code}Apache.NMS.NMSException: Invliad State: Not Currently in a Transaction at Apache.NMS.ActiveMQ.TransactionContext.Commit() at Apache.NMS.ActiveMQ.Session.Commit() at MassTransit.Transports.Nms.NmsTransport.Receive(Func`2 receiver, TimeSpan timeout) in D:\Development.OSS\Masstransit\src\Transports\MassTransit.Transports.Nms\NmsTransport.cs:line 112 at MassTransit.Transports.StreamEndpoint.Receive(Func`2 receiver, TimeSpan timeout) in D:\Development.OSS\Masstransit\src\MassTransit\Transports\StreamEndpoint.cs:line 65 at MassTransit.Internal.ServiceBusReceiveContext.ReceiveFromEndpoint() in D:\Development.OSS\Masstransit\src\MassTransit\Internal\ServiceBusReceiveContext.cs:line 62 {code} Looking further into this, i noticed that these only occur when trying to consume a message from the queue in transactional acknowledgement mode when NO mesasge is received in the timespan configured. A simple test i did show this: {code} [Test] public void session_can_be_commited_without_receiving_message() { using (Session testsession = connection.CreateSession(AcknowledgementMode.Transactional) as Session) { Assert.IsTrue(testsession.Transacted); // Assert.IsTrue(testsession.TransactionContext.InTransaction); using (IMessageConsumer oTestConsumer = testsession.CreateConsumer(new ActiveMQ.Commands.ActiveMQQueue(destinationName))) { IMessage oreceived = oTestConsumer.Receive(new TimeSpan(0, 0, 0, 0, 100)); Assert.IsNull(oreceived); testsession.Commit(); } } Assert.Pass("When getting here. It is ok"); } {code} was: When trying to upgrade the NMS libraries in the MassTransit, i noticed i started receiving exceptions: Apache.NMS.NMSException: Invliad State: Not Currently in a Transaction at Apache.NMS.ActiveMQ.TransactionContext.Commit() at Apache.NMS.ActiveMQ.Session.Commit() at MassTransit.Transports.Nms.NmsTransport.Receive(Func`2 receiver, TimeSpan timeout) in D:\Development.OSS\Masstransit\src\Transports\MassTransit.Transports.Nms\NmsTransport.cs:line 112 at MassTransit.Transports.StreamEndpoint.Receive(Func`2 receiver, TimeSpan timeout) in D:\Development.OSS\Masstransit\src\MassTransit\Transports\StreamEndpoint.cs:line 65 at MassTransit.Internal.ServiceBusReceiveContext.ReceiveFromEndpoint() in D:\Development.OSS\Masstransit\src\MassTransit\Internal\ServiceBusReceiveContext.cs:line 62 Looking further into this, i noticed that these only occur when trying to consume a message from the queue in transactional acknowledgement mode when NO mesasge is received in the timespan configured. A simple test i did show this: [Test] public void session_can_be_commited_without_receiving_message() { using (Session testsession = connection.CreateSession(AcknowledgementMode.Transactional) as Session) { Assert.IsTrue(testsession.Transacted); // Assert.IsTrue(testsession.TransactionContext.InTransaction); using (IMessageConsumer oTestConsumer = testsession.CreateConsumer(new ActiveMQ.Commands.ActiveMQQueue(destinationName))) { IMessage oreceived = oTestConsumer.Receive(new TimeSpan(0, 0, 0, 0, 100)); Assert.IsNull(oreceived); testsession.Commit(); } } Assert.Pass("When getting here. It is ok"); } > Session throws not in transaction error when no message has been received during transactional session > ------------------------------------------------------------------------------------------------------ > > Key: AMQNET-275 > URL: https://issues.apache.org/activemq/browse/AMQNET-275 > Project: ActiveMQ .Net > Issue Type: Bug > Components: ActiveMQ > Affects Versions: 1.3.0 > Environment: Any > Reporter: Michel Van Hoof > Assignee: Jim Gomes > Priority: Critical > > When trying to upgrade the NMS libraries in the MassTransit, i noticed i started receiving exceptions: > {code}Apache.NMS.NMSException: Invliad State: Not Currently in a Transaction > at Apache.NMS.ActiveMQ.TransactionContext.Commit() > at Apache.NMS.ActiveMQ.Session.Commit() > at MassTransit.Transports.Nms.NmsTransport.Receive(Func`2 receiver, TimeSpan timeout) in D:\Development.OSS\Masstransit\src\Transports\MassTransit.Transports.Nms\NmsTransport.cs:line 112 > at MassTransit.Transports.StreamEndpoint.Receive(Func`2 receiver, TimeSpan timeout) in D:\Development.OSS\Masstransit\src\MassTransit\Transports\StreamEndpoint.cs:line 65 > at MassTransit.Internal.ServiceBusReceiveContext.ReceiveFromEndpoint() in D:\Development.OSS\Masstransit\src\MassTransit\Internal\ServiceBusReceiveContext.cs:line 62 > {code} > Looking further into this, i noticed that these only occur when trying to consume a message from the queue in transactional acknowledgement mode when NO mesasge is received in the timespan configured. > A simple test i did show this: > {code} > [Test] > public void session_can_be_commited_without_receiving_message() > { > > > using (Session testsession = connection.CreateSession(AcknowledgementMode.Transactional) as Session) > { > Assert.IsTrue(testsession.Transacted); > // Assert.IsTrue(testsession.TransactionContext.InTransaction); > using (IMessageConsumer oTestConsumer = testsession.CreateConsumer(new ActiveMQ.Commands.ActiveMQQueue(destinationName))) > { > IMessage oreceived = oTestConsumer.Receive(new TimeSpan(0, 0, 0, 0, 100)); > Assert.IsNull(oreceived); > testsession.Commit(); > } > } > Assert.Pass("When getting here. It is ok"); > } > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.