Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 74715 invoked from network); 31 Mar 2006 21:27:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Mar 2006 21:27:14 -0000 Received: (qmail 42692 invoked by uid 500); 31 Mar 2006 21:27:05 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 42633 invoked by uid 500); 31 Mar 2006 21:27:05 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 42602 invoked by uid 99); 31 Mar 2006 21:27:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Mar 2006 13:27:04 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of chirino@gmail.com designates 64.233.162.199 as permitted sender) Received: from [64.233.162.199] (HELO zproxy.gmail.com) (64.233.162.199) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Mar 2006 13:27:03 -0800 Received: by zproxy.gmail.com with SMTP id 9so896440nzo for ; Fri, 31 Mar 2006 13:26:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ThTB0YsdmXeGJBe2RCiLSNL19tEvE/EcktOh1qSgxMZh8aG0L9FAZyGz62JX/UJzlaYHwAuESVX/lAXKCWd3eQ5JgXD1JbjFh42fClZxmpBPX4NxEsXPeN7x163Wx48zqby5P0bnbkZx9M3wwR4nw0EB/nieOAI6tWBotcoKNJk= Received: by 10.64.193.16 with SMTP id q16mr445800qbf; Fri, 31 Mar 2006 13:26:42 -0800 (PST) Received: by 10.65.234.8 with HTTP; Fri, 31 Mar 2006 13:26:42 -0800 (PST) Message-ID: Date: Fri, 31 Mar 2006 16:26:42 -0500 From: "Hiram Chirino" Sender: chirino@gmail.com To: activemq-users@geronimo.apache.org Subject: Re: ActiveMQ and JTA In-Reply-To: <3E7FE7F1841E3441A566885FEDDCDECE43BD24@SPR3V2.office.local> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <3E7FE7F1841E3441A566885FEDDCDECE43BD24@SPR3V2.office.local> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Meeraj, To have activemq connections be controlled by the J2EE container, you must use connections that have been created using the ActiveMQ resource adapter. See: http://activemq.com/Resource+Adapter Regards, Hiram On 3/31/06, Meeraj Kunnumpurath wrote: > Hi, > > I am using ActiveMQ 4.0 M4 standalone with the message consumers and > producers running from a separate Weblogic instance. I have got the > following code to send a message using JTA transaction demarcation, > > Context ctx =3D null; > Connection con =3D null; > Session sess =3D null; > > try { > context =3D new InitialContext(); > UserTransaction utx =3D > (UserTransaction)ctx.lookup("javax.transaction.UserTransaction"); > utx.begin(); > > ConnectionFactory cf =3D new > ActiveMQConnectionFactory("tcp://localhost:61616"); > Destination dst =3D new ActiveMQQueue("submission.queue"); > Connection con =3D cf.createConnection(); > Session sess =3D con.createSession(false, > Session.AUTO_ACKNOWLEDGE); > > MessageProducer prod =3D sess.createProducer(dst); > prod.send(sess.createTextMessage("Test")); > > con.stop(); > utx.rollback(); > > } catch(Exception ex) { > throw new RuntimeException(ex); > } finally { > closeResources(ctx, con, sess); > } > > The message is still being published, despite the transaction being > rolled back. Do I need to do anything else so that the ActiveMQ session > get enlisted with the transaction manager. > > Any pointers would be highly appreciated. > > Kind Regards > > Meeraj > > > > ***************************************************** > > You can find us at www.voca.com > > ***************************************************** > This communication is confidential and intended for > the exclusive use of the addressee only. You should > not disclose its contents to any other person. > If you are not the intended recipient please notify > the sender named above immediately. > > Registered in England, No 1023742, > Registered Office: Voca Limited > Drake House, Three Rivers Court, > Homestead Road, Rickmansworth, > Hertfordshire, WD3 1FX > > > This message has been checked for all email viruses by MessageLabs. > -- Regards, Hiram