From commits-return-43100-archive-asf-public=cust-asf.ponee.io@tomee.apache.org Fri Aug 31 07:04:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8C1E6180663 for ; Fri, 31 Aug 2018 07:04:05 +0200 (CEST) Received: (qmail 3655 invoked by uid 500); 31 Aug 2018 05:04:04 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 3646 invoked by uid 500); 31 Aug 2018 05:04:04 -0000 Delivered-To: apmail-openejb-commits@openejb.apache.org Received: (qmail 3643 invoked by uid 99); 31 Aug 2018 05:04:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2018 05:04:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 1B61A18079B for ; Fri, 31 Aug 2018 05:04:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.5 X-Spam-Level: X-Spam-Status: No, score=-109.5 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id f5A3oOgQ58ZY for ; Fri, 31 Aug 2018 05:04:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 6A0495F3AA for ; Fri, 31 Aug 2018 05:04:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8B525E00D3 for ; Fri, 31 Aug 2018 05:04:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 11EFC2183F for ; Fri, 31 Aug 2018 05:04:00 +0000 (UTC) Date: Fri, 31 Aug 2018 05:04:00 +0000 (UTC) From: "Romain Manni-Bucau (JIRA)" To: commits@openejb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TOMEE-2229) JMSContext Injected by TomEE does not participate in JTA, or at least sends messages immediately MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TOMEE-2229?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1659= 8249#comment-16598249 ]=20 Romain Manni-Bucau commented on TOMEE-2229: ------------------------------------------- Hi Jonathan =C2=A0 The scope is respected (see [https://github.com/apache/tomee/blob/master/co= ntainer/openejb-core/src/main/java/org/apache/openejb/resource/activemq/jms= 2/cdi/JMS2CDIExtension.java).] =C2=A0 You can ensure you use RA flavor of the connecrion factory but i think the = behavior is correct regarding your quote. =C2=A0 Romain > JMSContext Injected by TomEE does not participate in JTA, or at least sen= ds messages immediately > -------------------------------------------------------------------------= ----------------------- > > Key: TOMEE-2229 > URL: https://issues.apache.org/jira/browse/TOMEE-2229 > Project: TomEE > Issue Type: Bug > Components: TomEE Core Server > Affects Versions: 7.0.5 > Reporter: Jonathan S Fisher > Priority: Critical > > Hey guys, > We noticed that if you have a JMSContext in a transaction EJB or CDI Bean= , it always sends messages immediately instead of waiting for the XA to com= mit.=20 > We found this by injecting a JMSContext into an MDB marked with Transacti= onAttribute(Required), calling the jmsContext.createProducer() method, send= ing some messages, then sleeping the original MDB thread for several second= s. The messages arrive at their destinations immediately, long before the M= DB thread wakes up and the XA transaction completes. > Is there a chance our understanding is not correct? > According to the docs: > {quote}If the injected JMSContext is used in a JTA transaction (whether c= ontainer-managed or bean-managed), the JMSContext is considered to have tra= nsaction scope. This means that after the JTA transaction is committed, the= JMSContext will be automatically closed.{quote} > References: > * https://www.oracle.com/technetwork/articles/java/jms20-1947669.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)