[jira] [Commented] (TOMEE-2050) JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean

2017-06-02 Thread Svetlin Zarev (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16034515#comment-16034515
 ] 

Svetlin Zarev commented on TOMEE-2050:
--

No, I do not:

{code}
@WebServlet("/userTransaction")
public final class CdiTransactionaltest extends HttpServlet {

@Inject
TransactionalBean transactionalBean;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) 
throws ServletException, IOException {
final PrintWriter out = resp.getWriter();
resp.setContentType("text/plain");

try {
out.println("Testing with UserTransaction inside transactional 
bean...");
transactionalBean.testWithTxRequiredAndUserTransaction();
} catch (Exception ex) {
out.println("Exception: " + ex);
ex.printStackTrace(out);
}
}
}
{code}

The main transaction is initiated by the transactional intervceptor

> JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean
> 
>
> Key: TOMEE-2050
> URL: https://issues.apache.org/jira/browse/TOMEE-2050
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
> Attachments: ROOT.war, sample.zip, sample.zip
>
>
> JTA 1.2, section 3.7:
> {code}
> If an attempt is made to call any method of the UserTransaction interface 
> from within the scope of a bean or method annotated with @Transactional and a 
> Transactional.TxType other than NOT_SUPPORTED or NEVER, an 
> IllegalStateException must be thrown.
> {code}
> Instead TomEE throws:
> {code}
> 13:38:03.710 [http-nio-8080-exec-7] ERROR java.lang.Throwable - 
> javax.transaction.NotSupportedException: Nested Transactions are not supported
> 13:38:03.713 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
> 13:38:03.716 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
> ...
> ...
> ...
> 13:38:03.737 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113)
> 13:38:03.758 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106)
> 13:38:03.761 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67)
> 13:38:03.766 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.InterceptorBase.intercept(InterceptorBase.java:67)
> 13:38:03.770 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.RequiredInterceptor.intercept(RequiredInterceptor.java:35)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOMEE-2050) JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean

2017-06-02 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16034512#comment-16034512
 ] 

Romain Manni-Bucau commented on TOMEE-2050:
---

which is normal since you handle the main tx outside @Tx

> JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean
> 
>
> Key: TOMEE-2050
> URL: https://issues.apache.org/jira/browse/TOMEE-2050
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
> Attachments: sample.zip
>
>
> JTA 1.2, section 3.7:
> {code}
> If an attempt is made to call any method of the UserTransaction interface 
> from within the scope of a bean or method annotated with @Transactional and a 
> Transactional.TxType other than NOT_SUPPORTED or NEVER, an 
> IllegalStateException must be thrown.
> {code}
> Instead TomEE throws:
> {code}
> 13:38:03.710 [http-nio-8080-exec-7] ERROR java.lang.Throwable - 
> javax.transaction.NotSupportedException: Nested Transactions are not supported
> 13:38:03.713 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
> 13:38:03.716 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
> ...
> ...
> ...
> 13:38:03.737 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113)
> 13:38:03.758 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106)
> 13:38:03.761 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67)
> 13:38:03.766 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.InterceptorBase.intercept(InterceptorBase.java:67)
> 13:38:03.770 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.RequiredInterceptor.intercept(RequiredInterceptor.java:35)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOMEE-2050) JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean

2017-06-02 Thread Svetlin Zarev (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16034509#comment-16034509
 ] 

Svetlin Zarev commented on TOMEE-2050:
--

Well, but the attached WAR fails with the exception mentioned above when 
executed on vanilla TomEE. Just frop th eROOT.war in webapps and request 
http://localhost:8080/

> JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean
> 
>
> Key: TOMEE-2050
> URL: https://issues.apache.org/jira/browse/TOMEE-2050
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
> Attachments: sample.zip
>
>
> JTA 1.2, section 3.7:
> {code}
> If an attempt is made to call any method of the UserTransaction interface 
> from within the scope of a bean or method annotated with @Transactional and a 
> Transactional.TxType other than NOT_SUPPORTED or NEVER, an 
> IllegalStateException must be thrown.
> {code}
> Instead TomEE throws:
> {code}
> 13:38:03.710 [http-nio-8080-exec-7] ERROR java.lang.Throwable - 
> javax.transaction.NotSupportedException: Nested Transactions are not supported
> 13:38:03.713 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
> 13:38:03.716 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
> ...
> ...
> ...
> 13:38:03.737 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113)
> 13:38:03.758 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106)
> 13:38:03.761 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67)
> 13:38:03.766 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.InterceptorBase.intercept(InterceptorBase.java:67)
> 13:38:03.770 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.RequiredInterceptor.intercept(RequiredInterceptor.java:35)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOMEE-2050) JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean

2017-06-02 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16034502#comment-16034502
 ] 

Romain Manni-Bucau commented on TOMEE-2050:
---

this exact case is tested and passing

> JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean
> 
>
> Key: TOMEE-2050
> URL: https://issues.apache.org/jira/browse/TOMEE-2050
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
> Attachments: sample.zip
>
>
> JTA 1.2, section 3.7:
> {code}
> If an attempt is made to call any method of the UserTransaction interface 
> from within the scope of a bean or method annotated with @Transactional and a 
> Transactional.TxType other than NOT_SUPPORTED or NEVER, an 
> IllegalStateException must be thrown.
> {code}
> Instead TomEE throws:
> {code}
> 13:38:03.710 [http-nio-8080-exec-7] ERROR java.lang.Throwable - 
> javax.transaction.NotSupportedException: Nested Transactions are not supported
> 13:38:03.713 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
> 13:38:03.716 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
> ...
> ...
> ...
> 13:38:03.737 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113)
> 13:38:03.758 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106)
> 13:38:03.761 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67)
> 13:38:03.766 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.InterceptorBase.intercept(InterceptorBase.java:67)
> 13:38:03.770 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.RequiredInterceptor.intercept(RequiredInterceptor.java:35)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOMEE-2050) JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean

2017-06-02 Thread Svetlin Zarev (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16034495#comment-16034495
 ] 

Svetlin Zarev commented on TOMEE-2050:
--

Servlet:

{code}
@WebServlet("/userTransaction")
public final class CdiTransactionaltest extends HttpServlet {
@Resource
UserTransaction transaction;

@Inject
TransactionalBean transactionalBean;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) 
throws ServletException, IOException {
final PrintWriter out = resp.getWriter();
resp.setContentType("text/plain");

//other test cases here   

try {
out.println("Testing with UserTransaction inside transactional 
bean...");
transactionalBean.testWithTxRequiredAndUserTransaction();
} catch (Exception ex) {
out.println("Exception: " + ex);
ex.printStackTrace(out);
}
}
}
{code}

Transactional bean:

{code}
@Default
public class TransactionalBean {

@Resource
UserTransaction userTransaction;

//other test methods here

@Transactional(TxType.REQUIRED)
public void testWithTxRequiredAndUserTransaction() throws Exception {
userTransaction.begin();
userTransaction.commit();
}
}
{code}

Attaching zip with sample app (war + source)

> JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean
> 
>
> Key: TOMEE-2050
> URL: https://issues.apache.org/jira/browse/TOMEE-2050
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
> Attachments: sample.zip
>
>
> JTA 1.2, section 3.7:
> {code}
> If an attempt is made to call any method of the UserTransaction interface 
> from within the scope of a bean or method annotated with @Transactional and a 
> Transactional.TxType other than NOT_SUPPORTED or NEVER, an 
> IllegalStateException must be thrown.
> {code}
> Instead TomEE throws:
> {code}
> 13:38:03.710 [http-nio-8080-exec-7] ERROR java.lang.Throwable - 
> javax.transaction.NotSupportedException: Nested Transactions are not supported
> 13:38:03.713 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
> 13:38:03.716 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
> ...
> ...
> ...
> 13:38:03.737 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113)
> 13:38:03.758 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106)
> 13:38:03.761 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67)
> 13:38:03.766 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.InterceptorBase.intercept(InterceptorBase.java:67)
> 13:38:03.770 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.RequiredInterceptor.intercept(RequiredInterceptor.java:35)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TOMEE-2050) JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean

2017-06-02 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-2050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16034483#comment-16034483
 ] 

Romain Manni-Bucau commented on TOMEE-2050:
---

Why case do you have, we have a test validating we get

{code}
java.lang.IllegalStateException: Can't use UserTransaction from @Transaction 
call
{code}

> JTA 1.2 compliance: Calling UserTransaction methods from @Transactional bean
> 
>
> Key: TOMEE-2050
> URL: https://issues.apache.org/jira/browse/TOMEE-2050
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>
> JTA 1.2, section 3.7:
> {code}
> If an attempt is made to call any method of the UserTransaction interface 
> from within the scope of a bean or method annotated with @Transactional and a 
> Transactional.TxType other than NOT_SUPPORTED or NEVER, an 
> IllegalStateException must be thrown.
> {code}
> Instead TomEE throws:
> {code}
> 13:38:03.710 [http-nio-8080-exec-7] ERROR java.lang.Throwable - 
> javax.transaction.NotSupportedException: Nested Transactions are not supported
> 13:38:03.713 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
> 13:38:03.716 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)
> ...
> ...
> ...
> 13:38:03.737 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.directProceed(AbstractInvocationContext.java:113)
> 13:38:03.758 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.AbstractInvocationContext.proceed(AbstractInvocationContext.java:106)
> 13:38:03.761 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:67)
> 13:38:03.766 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.InterceptorBase.intercept(InterceptorBase.java:67)
> 13:38:03.770 [http-nio-8080-exec-7] ERROR java.lang.Throwable - at 
> org.apache.openejb.cdi.transactional.RequiredInterceptor.intercept(RequiredInterceptor.java:35)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)