weixin_39633437 2020-11-21 16:50
浏览 0

EJB Transaction created for TransactionAttributeType.NOT_SUPPORTED methods

Description

A method annotated with (TransactionAttributeType.NOT_SUPPORTED) should not have anEJB transaction created for it. See: https://javaee.github.io/javaee-spec/javadocs/javax/ejb/TransactionAttributeType.html#NOT_SUPPORTED

It seems to work correctly in Glassfish 5, but not in Payara. Payara creates a transaction, as if the annotation is ignored.

payara server.log glassfish server.log

Expected Outcome

No EJB transaction so no rollback. Tested on Glassfish

[2020-08-10T10:24:09.994+0200] [glassfish 5.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=107 _ThreadName=admin-listener(4)] [timeMillis: 1597047849994] [levelValue: 800] [[ timeoutTest was successfully deployed in 17,522 milliseconds.]]

[2020-08-10T10:25:00.021+0200] [glassfish 5.0] [INFO] [] [Facade1] [tid: _ThreadID=211 _ThreadName=__ejb-thread-pool1] [timeMillis: 1597047900021] [levelValue: 800] [[ Starting runTest]]

[2020-08-10T10:25:08.023+0200] [glassfish 5.0] [INFO] [] [Facade1] [tid: _ThreadID=211 _ThreadName=__ejb-thread-pool1] [timeMillis: 1597047908023] [levelValue: 800] [[ Done with runTest]]

Current Outcome

An EJB transaction that times out Tested on Payara

[2020-08-10T10:12:26.633+0200] [Payara 5.184] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=100 _ThreadName=admin-thread-pool::admin-listener(1)] [timeMillis: 1597047146633] [levelValue: 800] [[ timeoutTest was successfully deployed in 5,051 milliseconds.]]

[2020-08-10T10:13:00.016+0200] [Payara 5.184] [INFO] [] [Facade1] [tid: _ThreadID=294 _ThreadName=__ejb-thread-pool5] [timeMillis: 1597047180016] [levelValue: 800] [[ Starting runTest]]

[2020-08-10T10:13:08.016+0200] [Payara 5.184] [INFO] [] [Facade1] [tid: _ThreadID=294 _ThreadName=__ejb-thread-pool5] [timeMillis: 1597047188016] [levelValue: 800] [[ Done with runTest]]

[2020-08-10T10:13:08.017+0200] [Payara 5.184] [WARNING] [] [javax.enterprise.system.container.ejb.com.sun.ejb.containers] [tid: _ThreadID=294 _ThreadName=__ejb-thread-pool5] [timeMillis: 1597047188017] [levelValue: 900] [[ EJB5123:Rolling back timed out transaction [JavaEETransactionImpl: txId=15 nonXAResource=null jtsTx=null localTxStatus=4 syncs=[com.sun.ejb.containers.ContainerSynchronization]] for [Facade1]]]

Steps to reproduce (Only for bug reports)

1 - Run payara, open admin console 2 - Go to Transaction Service -> Transaction Timeout 3 - Change to 5 seconds (For this test) 4 - Save and restart Payara. 5 - Run the Sample app below (Deploy the timeoutTest.war file) 6 - Check log file

Samples

timeoutTest.zip

Context (Optional)

We use methods to do processing of data and would like the main schedule method not to have a transaction. We will create a transaction per record to process.

Environment

  • Payara Version: 5.184 and 5.201
  • Edition: Full
  • JDK Version: AWS Corretto jdk1.8.0_232 and AWS Corretto jdk1.8.0_242
  • Operating System: Windows
  • Database: None

该提问来源于开源项目:payara/Payara

  • 写回答

7条回答 默认 最新

  • weixin_39633437 2020-11-21 16:50
    关注

    Added log files of test running on Payara and Glassfish

    评论

报告相同问题?