[ https://issues.apache.org/jira/browse/OPENEJB-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013759#comment-15013759 ]
Romain Manni-Bucau commented on OPENEJB-2122: --------------------------------------------- pushed this test which is more or less your classes: https://git-wip-us.apache.org/repos/asf?p=tomee.git;a=blob;f=container/openejb-core/src/test/java/org/apache/openejb/cdi/transactional/TransactionalOPENEJB2122Test.java;h=70a9fd56d56389d1f5857c97c3f50f03b5c441b2;hb=1b6536fecacbf8a16a9ed876820eb0cf816e99c7 looks fine so maybe something different in the way you call it Side note: testing on master your classes deployment fails cause of this scoped stateless which is normally forbidden - stateless have to be dependent. > New Transaction gets rolled back > -------------------------------- > > Key: OPENEJB-2122 > URL: https://issues.apache.org/jira/browse/OPENEJB-2122 > Project: OpenEJB > Issue Type: Bug > Environment: Java 8 update 51 64bit > Windows 7 > Reporter: Pascal Knüppel > Priority: Critical > > I am currently on a project where I need to rollback only part of my > transaction. I tested my code on wildfly and it works perfectly. With openejb > though all my transactions are rolled back and I am not able to find a > workaround. > I have a really simple stateless bean which calls 2 methods. One method has > attribute transaction required and the second has transaction requires new. > {code:title=MyTestRessource.java|borderStyle=solid} > @Stateless > @Path("test") > public class MyTestRessource { > @Inject > private MyTestBean myTestBean; > @GET > @Path("testMethod") > @Transactional(Transactional.TxType.NOT_SUPPORTED) > public String simpleTestMethod() { > myTestBean.persistAnEntity(); > myTestBean.doOnFail(); > return "execution finished"; > } > } > {code} > {code:title=MyTestBean.java|borderStyle=solid} > @Stateless > @Path("test") > @RequestScoped > public class MyTestBean { > @Inject > @Named(EntityManagerProducer.oracleEntityManagerName) > private EntityManager oracleEntityManager; > @Resource > private SessionContext sessionContext; > @Transactional(Transactional.TxType.REQUIRED) > public void persistAnEntity() { > FRX_SECURITYVERSION frx_securityversion = new FRX_SECURITYVERSION( > "SV0111", new Date() > ); > oracleEntityManager.persist(frx_securityversion); > sessionContext.setRollbackOnly(); > } > @Transactional(Transactional.TxType.REQUIRES_NEW) > public void doOnFail() { > FRX_SECURITYVERSION frx_securityversion = new FRX_SECURITYVERSION( > "SV0100", new Date(System.currentTimeMillis() + 1000L * 60 * > 60 * 24 * 365 * 999) > ); > oracleEntityManager.persist(frx_securityversion); > } > } > {code} > If I execute this code in wildfly I get no problems and the entry from the > second method is persisted while the first is rolled back. With openejb both > entries are rolled back. Is there anything I am missing? -- This message was sent by Atlassian JIRA (v6.3.4#6332)