tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan S Fisher (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TOMEE-2229) JMSContext Injected by TomEE does not participate in JTA, or at least sends messages immediately
Date Fri, 31 Aug 2018 00:42:00 GMT

     [ https://issues.apache.org/jira/browse/TOMEE-2229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jonathan S Fisher updated TOMEE-2229:
-------------------------------------
    Description: 
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 commit. 

We found this by injecting a JMSContext into an MDB marked with TransactionAttribute(Required),
calling the jmsContext.createProducer() method, sending some messages, then sleeping the original
MDB thread for several seconds. The messages arrive at their destinations immediately, long
before the MDB 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 container-managed
or bean-managed), the JMSContext is considered to have transaction 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

  was:
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 commit. 

We found this by injecting a JMSContext into an MDB, calling the jmsContext.createProducer()
method, sending some messages, then sleeping the MDB thread for several seconds. The messages
arrive at their destinations immediately, instead of waiting for the MDB thread to wake back
up.

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 container-managed
or bean-managed), the JMSContext is considered to have transaction 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


> JMSContext Injected by TomEE does not participate in JTA, or at least sends 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 commit. 
> We found this by injecting a JMSContext into an MDB marked with TransactionAttribute(Required),
calling the jmsContext.createProducer() method, sending some messages, then sleeping the original
MDB thread for several seconds. The messages arrive at their destinations immediately, long
before the MDB 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 container-managed
or bean-managed), the JMSContext is considered to have transaction 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)

Mime
View raw message