New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara does NOT rollback when RuntimeException occurs in CDI @Transactional method using JDBC #505

Closed
MasatoshiTada opened this Issue Nov 1, 2015 · 7 comments

Comments

Projects
None yet
2 participants
@MasatoshiTada

MasatoshiTada commented Nov 1, 2015

Hello.

I tried to use JDBC+CDI+JTA in Payara Web ML 4.1.1.154.
Database is PostgreSQL 9.4, and JDBC resource named "jdbc/sandbox" is XADataSource.

My code is here.
https://github.com/MasatoshiTada/TransactionalSample-Doma/blob/master/src/main/java/com/example/jdbc/JdbcCdiRequiredTestDao.java

@RequestScoped
public class JdbcCdiRequiredTestDao implements Serializable {
    @Resource(lookup = "jdbc/sandbox")
    private DataSource dataSource;

    private int insert(TestEntity testEntity) throws Exception {
        String sql = "INSERT INTO test_entity(id, thrown, rollbackon, dontrollbackon, expected) VALUES(?, ?, ?, ?, ?)";
        try (Connection con = dataSource.getConnection();
               PreparedStatement ps = con.prepareStatement(sql)) {
            ps.setInt(1, testEntity.getId());
            ps.setString(2, testEntity.getThrown());
            ps.setString(3, testEntity.getRollbackOn());
            ps.setString(4, testEntity.getDontRollbackOn());
            ps.setString(5, testEntity.getExpected());
            int rows = ps.executeUpdate();
            return rows;
        }
    }

    /** ************************************************************************
     * 01. rollbackOn={} dontRollbackOn={}
     * @throws NullPointerException
     * *************************************************************************
     */
    @Transactional(value = Transactional.TxType.REQUIRED,
            rollbackOn = {},
            dontRollbackOn = {})
    public void insert01RollbackOnNoDontRollbackonNoThrowsNPE(TestEntity testEntity) throws Exception {
        this.insert(testEntity);
        throw new NullPointerException();  // Payara does not rollback!!!!!!
    }
    ...

I think it is not in accordance with the JTA specification.
When I created DAO class as @stateless EJB, Payara rollback.

JDBC + CDI -> NG
JDBC + EJB -> OK
JPA + CDI -> OK (Why???)
JPA + EJB -> OK
Doma + CDI -> NG
Doma + EJB -> OK
(Doma is Japanese O/R mapping framework)

I hope to use Doma or MyBatis (not JPA) in Payara.
I'm very troubled by this problem.
Please check this issue.

This is my first issue comment in my life, and I'm not good at English writing...
I'm very sorry for my English writing (-:

@MasatoshiTada

This comment has been minimized.

Show comment
Hide comment
@MasatoshiTada

MasatoshiTada Nov 1, 2015

Log is here.
nonXAResource and jtsTx is null.

[2015-11-01T13:12:40.163+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160163] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-01T13:12:40.164+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160164] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-01T13:12:40.194+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160194] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-01T13:12:40.194+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160194] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-01T13:12:40.200+0900] [Payara 4.1] [INFO] [] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160200] [levelValue: 800] [[
  Error during transaction processing
java.lang.NullPointerException
    at com.example.jdbc.JdbcCdiRequiredTestDao.insert01RollbackOnNoDontRollbackonNoThrowsNPE(JdbcCdiRequiredTestDao.java:83)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE$$super(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:49)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.jersey.ext.cdi1x.transaction.internal.WebAppExceptionInterceptor.intercept(WebAppExceptionInterceptor.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.NonTerminalAroundInvokeInvocationContext.proceedInternal(NonTerminalAroundInvokeInvocationContext.java:64)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.cdi.transaction.TransactionalInterceptorBase.proceed(TransactionalInterceptorBase.java:226)
    at org.glassfish.cdi.transaction.TransactionalInterceptorRequired.transactional(TransactionalInterceptorRequired.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:84)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:72)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:56)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldClientProxy.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.lambda$doGet$39(JdbcCdiRequiredTestServlet.java:28)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.executeQuietly(JdbcCdiRequiredTestServlet.java:80)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.doGet(JdbcCdiRequiredTestServlet.java:28)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:745)
]]

[2015-11-01T13:12:40.200+0900] [Payara 4.1] [INFO] [AS-JTA-00002] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160200] [levelValue: 800] [[
  About to setRollbackOnly from @Transactional interceptor on transaction: JavaEETransactionImpl: txId=2 nonXAResource=null jtsTx=null localTxStatus=1 syncs=[]]]

[2015-11-01T13:12:40.203+0900] [Payara 4.1] [INFO] [] [] [tid: _ThreadID=25 _ThreadName=Thread-8] [timeMillis: 1446351160203] [levelValue: 800] [[
  null]]

MasatoshiTada commented Nov 1, 2015

Log is here.
nonXAResource and jtsTx is null.

[2015-11-01T13:12:40.163+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160163] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-01T13:12:40.164+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160164] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-01T13:12:40.194+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160194] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-01T13:12:40.194+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160194] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-01T13:12:40.200+0900] [Payara 4.1] [INFO] [] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160200] [levelValue: 800] [[
  Error during transaction processing
java.lang.NullPointerException
    at com.example.jdbc.JdbcCdiRequiredTestDao.insert01RollbackOnNoDontRollbackonNoThrowsNPE(JdbcCdiRequiredTestDao.java:83)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE$$super(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:49)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.jersey.ext.cdi1x.transaction.internal.WebAppExceptionInterceptor.intercept(WebAppExceptionInterceptor.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.NonTerminalAroundInvokeInvocationContext.proceedInternal(NonTerminalAroundInvokeInvocationContext.java:64)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.cdi.transaction.TransactionalInterceptorBase.proceed(TransactionalInterceptorBase.java:226)
    at org.glassfish.cdi.transaction.TransactionalInterceptorRequired.transactional(TransactionalInterceptorRequired.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:84)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:72)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:56)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldClientProxy.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.lambda$doGet$39(JdbcCdiRequiredTestServlet.java:28)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.executeQuietly(JdbcCdiRequiredTestServlet.java:80)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.doGet(JdbcCdiRequiredTestServlet.java:28)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:745)
]]

[2015-11-01T13:12:40.200+0900] [Payara 4.1] [INFO] [AS-JTA-00002] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160200] [levelValue: 800] [[
  About to setRollbackOnly from @Transactional interceptor on transaction: JavaEETransactionImpl: txId=2 nonXAResource=null jtsTx=null localTxStatus=1 syncs=[]]]

[2015-11-01T13:12:40.203+0900] [Payara 4.1] [INFO] [] [] [tid: _ThreadID=25 _ThreadName=Thread-8] [timeMillis: 1446351160203] [levelValue: 800] [[
  null]]

@smillidge

This comment has been minimized.

Show comment
Hide comment
@smillidge

smillidge Nov 3, 2015

Contributor

Thanks for the test case we will try to reproduce the problem with your test case

Contributor

smillidge commented Nov 3, 2015

Thanks for the test case we will try to reproduce the problem with your test case

@smillidge

This comment has been minimized.

Show comment
Hide comment
@smillidge

smillidge Nov 3, 2015

Contributor

The log message

2015-11-01T13:12:40.200+0900] [Payara 4.1] [INFO] [AS-JTA-00002] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160200] [levelValue: 800] [[
  About to setRollbackOnly from @Transactional interceptor on transaction: JavaEETransactionImpl: txId=2 nonXAResource=null jtsTx=null localTxStatus=1 syncs=[]]]

Seems to suggest that the interceptor is trying to set rollback on the transaction correctly. Can you check the autocommit setting on the JDBC connection is set to false.

Contributor

smillidge commented Nov 3, 2015

The log message

2015-11-01T13:12:40.200+0900] [Payara 4.1] [INFO] [AS-JTA-00002] [javax.enterprise.resource.jta] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1446351160200] [levelValue: 800] [[
  About to setRollbackOnly from @Transactional interceptor on transaction: JavaEETransactionImpl: txId=2 nonXAResource=null jtsTx=null localTxStatus=1 syncs=[]]]

Seems to suggest that the interceptor is trying to set rollback on the transaction correctly. Can you check the autocommit setting on the JDBC connection is set to false.

@MasatoshiTada

This comment has been minimized.

Show comment
Hide comment
@MasatoshiTada

MasatoshiTada Nov 4, 2015

Thank you for your comment and seeing my test programs.
Following your advice, I added a property to connection pool to set auto commit false, and modified my programs(add Connection#setAutoCommit(false)).
But, it doesn't work. Payara does not rollback. All records are committed.

My processes are below.


(1) Add property to connection pool
I read PostgreSQL JDBC Driver's reference -> https://jdbc.postgresql.org/documentation/94/ds-cpds.html
This page says property "defaultAutoCommit" is false.

To make sure, I add this property to my JDBC connection pool "SandboxPool" from Payara Admin Console.
Here is the result of "asadmin get" command.

$ pwd
/Users/tada/Java/ap-server/payara-web-4.1.1.154-ml/bin
$ ./asadmin get "domain.resources.jdbc-connection-pool.SandboxPool.property.*"
domain.resources.jdbc-connection-pool.SandboxPool.property.UnknownLength=2147483647
domain.resources.jdbc-connection-pool.SandboxPool.property.SocketTimeout=0
domain.resources.jdbc-connection-pool.SandboxPool.property.DisableColumnSanitiser=false
domain.resources.jdbc-connection-pool.SandboxPool.property.PreparedStatementCacheSizeMiB=5
domain.resources.jdbc-connection-pool.SandboxPool.property.PrepareThreshold=5
domain.resources.jdbc-connection-pool.SandboxPool.property.SendBufferSize=-1
domain.resources.jdbc-connection-pool.SandboxPool.property.GssLib=auto
domain.resources.jdbc-connection-pool.SandboxPool.property.Url=jdbc:postgresql://localhost:5432/sandbox
domain.resources.jdbc-connection-pool.SandboxPool.property.PortNumber=0
domain.resources.jdbc-connection-pool.SandboxPool.property.ProtocolVersion=0
domain.resources.jdbc-connection-pool.SandboxPool.property.ServerName=localhost
domain.resources.jdbc-connection-pool.SandboxPool.property.LoadBalanceHosts=true
domain.resources.jdbc-connection-pool.SandboxPool.property.Loglevel=0
domain.resources.jdbc-connection-pool.SandboxPool.property.Compatible=9.4
domain.resources.jdbc-connection-pool.SandboxPool.property.AllowEncodingChanges=false
domain.resources.jdbc-connection-pool.SandboxPool.property.ReceiveBufferSize=-1
# I add this property
domain.resources.jdbc-connection-pool.SandboxPool.property.defaultAutoCommit=false
domain.resources.jdbc-connection-pool.SandboxPool.property.Password=XXXXXXXX
domain.resources.jdbc-connection-pool.SandboxPool.property.LogUnclosedConnections=false
domain.resources.jdbc-connection-pool.SandboxPool.property.SspiServiceClass=POSTGRES
domain.resources.jdbc-connection-pool.SandboxPool.property.HostRecheckSeconds=10
domain.resources.jdbc-connection-pool.SandboxPool.property.Ssl=false
domain.resources.jdbc-connection-pool.SandboxPool.property.User=XXXXXXXX
domain.resources.jdbc-connection-pool.SandboxPool.property.ReadOnly=false
domain.resources.jdbc-connection-pool.SandboxPool.property.UseSpNego=false
domain.resources.jdbc-connection-pool.SandboxPool.property.DefaultRowFetchSize=0
domain.resources.jdbc-connection-pool.SandboxPool.property.TargetServerType=any
domain.resources.jdbc-connection-pool.SandboxPool.property.TcpKeepAlive=false
domain.resources.jdbc-connection-pool.SandboxPool.property.BinaryTransfer=true
domain.resources.jdbc-connection-pool.SandboxPool.property.PreparedStatementCacheQueries=256
domain.resources.jdbc-connection-pool.SandboxPool.property.LogLevel=0
domain.resources.jdbc-connection-pool.SandboxPool.property.LoginTimeout=0
domain.resources.jdbc-connection-pool.SandboxPool.property.ConnectTimeout=0
Command get executed successfully.

(2) Add Connection#setAutoCommit(false)
I pushed modified programs to GitHub.
Here is the diff -> MasatoshiTada/TransactionalSample-Doma@276ae32

@RequestScoped
public class JdbcCdiRequiredTestDao implements Serializable {

    @Resource(lookup = "jdbc/sandbox")
    private DataSource dataSource;

    private Connection getNonAutoCommitConnection() throws Exception {
        Connection con = dataSource.getConnection();
        // set to false
        con.setAutoCommit(false);
        return con;
    }

    private int insert(TestEntity testEntity) throws Exception {
        String sql = "INSERT INTO test_entity(id, thrown, rollbackon, dontrollbackon, expected) VALUES(?, ?, ?, ?, ?)";
        try (Connection con = this.getNonAutoCommitConnection();
               PreparedStatement ps = con.prepareStatement(sql)) {
            ps.setInt(1, testEntity.getId());
            ps.setString(2, testEntity.getThrown());
            ps.setString(3, testEntity.getRollbackOn());
            ps.setString(4, testEntity.getDontRollbackOn());
            ps.setString(5, testEntity.getExpected());
            int rows = ps.executeUpdate();
            return rows;
        }
    }


    /** ************************************************************************
     * 01. rollbackOn={} dontRollbackOn={}
     * @throws NullPointerException
     * *************************************************************************
     */
    @Transactional(value = Transactional.TxType.REQUIRED,
            rollbackOn = {},
            dontRollbackOn = {})
    public void insert01RollbackOnNoDontRollbackonNoThrowsNPE(TestEntity testEntity) throws Exception {
        this.insert(testEntity);
        throw new NullPointerException();
    }
    // more methods are below

(3) Run test program
Payara does not rollback...

[2015-11-04T14:18:46.256+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326256] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-04T14:18:46.259+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326259] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-04T14:18:46.289+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326289] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-04T14:18:46.290+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326290] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-04T14:18:46.296+0900] [Payara 4.1] [INFO] [] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326296] [levelValue: 800] [[
  Error during transaction processing
java.lang.NullPointerException
    at com.example.jdbc.JdbcCdiRequiredTestDao.insert01RollbackOnNoDontRollbackonNoThrowsNPE(JdbcCdiRequiredTestDao.java:89)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE$$super(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:49)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.jersey.ext.cdi1x.transaction.internal.WebAppExceptionInterceptor.intercept(WebAppExceptionInterceptor.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.NonTerminalAroundInvokeInvocationContext.proceedInternal(NonTerminalAroundInvokeInvocationContext.java:64)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.cdi.transaction.TransactionalInterceptorBase.proceed(TransactionalInterceptorBase.java:226)
    at org.glassfish.cdi.transaction.TransactionalInterceptorRequired.transactional(TransactionalInterceptorRequired.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:84)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:72)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:56)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldClientProxy.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.lambda$doGet$39(JdbcCdiRequiredTestServlet.java:28)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.executeQuietly(JdbcCdiRequiredTestServlet.java:80)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.doGet(JdbcCdiRequiredTestServlet.java:28)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:745)
]]

[2015-11-04T14:18:46.297+0900] [Payara 4.1] [INFO] [AS-JTA-00002] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326297] [levelValue: 800] [[
  About to setRollbackOnly from @Transactional interceptor on transaction: JavaEETransactionImpl: txId=2 nonXAResource=null jtsTx=null localTxStatus=4 syncs=[]]]

[2015-11-04T14:18:46.297+0900] [Payara 4.1] [INFO] [] [] [tid: _ThreadID=26 _ThreadName=Thread-8] [timeMillis: 1446614326297] [levelValue: 800] [[
  null]]

My friend who use MySQL has same problem.

I'm very confused...
There is something wrong in my setting or program?

MasatoshiTada commented Nov 4, 2015

Thank you for your comment and seeing my test programs.
Following your advice, I added a property to connection pool to set auto commit false, and modified my programs(add Connection#setAutoCommit(false)).
But, it doesn't work. Payara does not rollback. All records are committed.

My processes are below.


(1) Add property to connection pool
I read PostgreSQL JDBC Driver's reference -> https://jdbc.postgresql.org/documentation/94/ds-cpds.html
This page says property "defaultAutoCommit" is false.

To make sure, I add this property to my JDBC connection pool "SandboxPool" from Payara Admin Console.
Here is the result of "asadmin get" command.

$ pwd
/Users/tada/Java/ap-server/payara-web-4.1.1.154-ml/bin
$ ./asadmin get "domain.resources.jdbc-connection-pool.SandboxPool.property.*"
domain.resources.jdbc-connection-pool.SandboxPool.property.UnknownLength=2147483647
domain.resources.jdbc-connection-pool.SandboxPool.property.SocketTimeout=0
domain.resources.jdbc-connection-pool.SandboxPool.property.DisableColumnSanitiser=false
domain.resources.jdbc-connection-pool.SandboxPool.property.PreparedStatementCacheSizeMiB=5
domain.resources.jdbc-connection-pool.SandboxPool.property.PrepareThreshold=5
domain.resources.jdbc-connection-pool.SandboxPool.property.SendBufferSize=-1
domain.resources.jdbc-connection-pool.SandboxPool.property.GssLib=auto
domain.resources.jdbc-connection-pool.SandboxPool.property.Url=jdbc:postgresql://localhost:5432/sandbox
domain.resources.jdbc-connection-pool.SandboxPool.property.PortNumber=0
domain.resources.jdbc-connection-pool.SandboxPool.property.ProtocolVersion=0
domain.resources.jdbc-connection-pool.SandboxPool.property.ServerName=localhost
domain.resources.jdbc-connection-pool.SandboxPool.property.LoadBalanceHosts=true
domain.resources.jdbc-connection-pool.SandboxPool.property.Loglevel=0
domain.resources.jdbc-connection-pool.SandboxPool.property.Compatible=9.4
domain.resources.jdbc-connection-pool.SandboxPool.property.AllowEncodingChanges=false
domain.resources.jdbc-connection-pool.SandboxPool.property.ReceiveBufferSize=-1
# I add this property
domain.resources.jdbc-connection-pool.SandboxPool.property.defaultAutoCommit=false
domain.resources.jdbc-connection-pool.SandboxPool.property.Password=XXXXXXXX
domain.resources.jdbc-connection-pool.SandboxPool.property.LogUnclosedConnections=false
domain.resources.jdbc-connection-pool.SandboxPool.property.SspiServiceClass=POSTGRES
domain.resources.jdbc-connection-pool.SandboxPool.property.HostRecheckSeconds=10
domain.resources.jdbc-connection-pool.SandboxPool.property.Ssl=false
domain.resources.jdbc-connection-pool.SandboxPool.property.User=XXXXXXXX
domain.resources.jdbc-connection-pool.SandboxPool.property.ReadOnly=false
domain.resources.jdbc-connection-pool.SandboxPool.property.UseSpNego=false
domain.resources.jdbc-connection-pool.SandboxPool.property.DefaultRowFetchSize=0
domain.resources.jdbc-connection-pool.SandboxPool.property.TargetServerType=any
domain.resources.jdbc-connection-pool.SandboxPool.property.TcpKeepAlive=false
domain.resources.jdbc-connection-pool.SandboxPool.property.BinaryTransfer=true
domain.resources.jdbc-connection-pool.SandboxPool.property.PreparedStatementCacheQueries=256
domain.resources.jdbc-connection-pool.SandboxPool.property.LogLevel=0
domain.resources.jdbc-connection-pool.SandboxPool.property.LoginTimeout=0
domain.resources.jdbc-connection-pool.SandboxPool.property.ConnectTimeout=0
Command get executed successfully.

(2) Add Connection#setAutoCommit(false)
I pushed modified programs to GitHub.
Here is the diff -> MasatoshiTada/TransactionalSample-Doma@276ae32

@RequestScoped
public class JdbcCdiRequiredTestDao implements Serializable {

    @Resource(lookup = "jdbc/sandbox")
    private DataSource dataSource;

    private Connection getNonAutoCommitConnection() throws Exception {
        Connection con = dataSource.getConnection();
        // set to false
        con.setAutoCommit(false);
        return con;
    }

    private int insert(TestEntity testEntity) throws Exception {
        String sql = "INSERT INTO test_entity(id, thrown, rollbackon, dontrollbackon, expected) VALUES(?, ?, ?, ?, ?)";
        try (Connection con = this.getNonAutoCommitConnection();
               PreparedStatement ps = con.prepareStatement(sql)) {
            ps.setInt(1, testEntity.getId());
            ps.setString(2, testEntity.getThrown());
            ps.setString(3, testEntity.getRollbackOn());
            ps.setString(4, testEntity.getDontRollbackOn());
            ps.setString(5, testEntity.getExpected());
            int rows = ps.executeUpdate();
            return rows;
        }
    }


    /** ************************************************************************
     * 01. rollbackOn={} dontRollbackOn={}
     * @throws NullPointerException
     * *************************************************************************
     */
    @Transactional(value = Transactional.TxType.REQUIRED,
            rollbackOn = {},
            dontRollbackOn = {})
    public void insert01RollbackOnNoDontRollbackonNoThrowsNPE(TestEntity testEntity) throws Exception {
        this.insert(testEntity);
        throw new NullPointerException();
    }
    // more methods are below

(3) Run test program
Payara does not rollback...

[2015-11-04T14:18:46.256+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326256] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-04T14:18:46.259+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326259] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-04T14:18:46.289+0900] [Payara 4.1] [INFO] [AS-JTA-00009] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326289] [levelValue: 800] [[
  In REQUIRED TransactionalInterceptor]]

[2015-11-04T14:18:46.290+0900] [Payara 4.1] [INFO] [AS-JTA-00010] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326290] [levelValue: 800] [[
  Managed bean with Transactional annotation and TxType of REQUIRED called outside a transaction context.  Beginning a transaction...]]

[2015-11-04T14:18:46.296+0900] [Payara 4.1] [INFO] [] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326296] [levelValue: 800] [[
  Error during transaction processing
java.lang.NullPointerException
    at com.example.jdbc.JdbcCdiRequiredTestDao.insert01RollbackOnNoDontRollbackonNoThrowsNPE(JdbcCdiRequiredTestDao.java:89)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE$$super(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.proxy.TerminalAroundInvokeInvocationContext.proceedInternal(TerminalAroundInvokeInvocationContext.java:49)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.jersey.ext.cdi1x.transaction.internal.WebAppExceptionInterceptor.intercept(WebAppExceptionInterceptor.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.NonTerminalAroundInvokeInvocationContext.proceedInternal(NonTerminalAroundInvokeInvocationContext.java:64)
    at org.jboss.weld.interceptor.proxy.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:77)
    at org.glassfish.cdi.transaction.TransactionalInterceptorBase.proceed(TransactionalInterceptorBase.java:226)
    at org.glassfish.cdi.transaction.TransactionalInterceptorRequired.transactional(TransactionalInterceptorRequired.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeAroundInvoke(InterceptorMethodHandler.java:84)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:72)
    at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:56)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:79)
    at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:68)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldSubclass.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestDao$Proxy$_$$_WeldClientProxy.insert01RollbackOnNoDontRollbackonNoThrowsNPE(Unknown Source)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.lambda$doGet$39(JdbcCdiRequiredTestServlet.java:28)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.executeQuietly(JdbcCdiRequiredTestServlet.java:80)
    at com.example.jdbc.JdbcCdiRequiredTestServlet.doGet(JdbcCdiRequiredTestServlet.java:28)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:745)
]]

[2015-11-04T14:18:46.297+0900] [Payara 4.1] [INFO] [AS-JTA-00002] [javax.enterprise.resource.jta] [tid: _ThreadID=26 _ThreadName=http-listener-1(2)] [timeMillis: 1446614326297] [levelValue: 800] [[
  About to setRollbackOnly from @Transactional interceptor on transaction: JavaEETransactionImpl: txId=2 nonXAResource=null jtsTx=null localTxStatus=4 syncs=[]]]

[2015-11-04T14:18:46.297+0900] [Payara 4.1] [INFO] [] [] [tid: _ThreadID=26 _ThreadName=Thread-8] [timeMillis: 1446614326297] [levelValue: 800] [[
  null]]

My friend who use MySQL has same problem.

I'm very confused...
There is something wrong in my setting or program?

@smillidge

This comment has been minimized.

Show comment
Hide comment
@smillidge

smillidge Nov 14, 2015

Contributor

We think this is a bug in upstream

Contributor

smillidge commented Nov 14, 2015

We think this is a bug in upstream

@MasatoshiTada

This comment has been minimized.

Show comment
Hide comment
@MasatoshiTada

MasatoshiTada Nov 15, 2015

Thank you for your bug fix!

MasatoshiTada commented Nov 15, 2015

Thank you for your bug fix!

@MasatoshiTada

This comment has been minimized.

Show comment
Hide comment
@MasatoshiTada

MasatoshiTada Feb 12, 2016

Hello. I'm very glad about release of Payara 4.1.1.161.
I've tried just now, and I saw this bug is fixed when TxType is REQUIRED.

But, it seems this bug is NOT fixed when TxType is REQUIRES_NEW.
All record are committed (both checked exception and unchecked exception).

Please try my test program again.

https://github.com/MasatoshiTada/TransactionalSample-Doma/blob/master/src/main/java/com/example/jdbc/JdbcCdiRequiresNewTestDao.java

And if you need, please reopen this issue.

MasatoshiTada commented Feb 12, 2016

Hello. I'm very glad about release of Payara 4.1.1.161.
I've tried just now, and I saw this bug is fixed when TxType is REQUIRED.

But, it seems this bug is NOT fixed when TxType is REQUIRES_NEW.
All record are committed (both checked exception and unchecked exception).

Please try my test program again.

https://github.com/MasatoshiTada/TransactionalSample-Doma/blob/master/src/main/java/com/example/jdbc/JdbcCdiRequiresNewTestDao.java

And if you need, please reopen this issue.

MeroRai pushed a commit to MeroRai/Payara that referenced this issue Oct 10, 2018

Susan Rai
Merged in PAYARA-3153-payara-server-5.183.maintenance (pull request p…
…ayara#505)

PAYARA-3153 OpenAPI doesn't support child schema on @...Param annotations - 5.183.maintenance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment