Bug 1466909 - TransactionAttribute annotation is inherited from interface which not according to the spec
Summary: TransactionAttribute annotation is inherited from interface which not accordi...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.4.14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Radovan STANCEL
QA Contact: Pavel Slavicek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-30 17:31 UTC by wfink
Modified: 2019-08-19 12:44 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-08-19 12:44:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-11909 0 Major Pull Request Sent [7.0.z] TransactionAttribute annotation is inherited from interface which not according to the spec 2018-02-27 16:52:17 UTC
Red Hat Issue Tracker JBEAP-11910 0 Major Pull Request Sent [7.1.z] TransactionAttribute annotation is inherited from interface which not according to the spec 2018-02-28 05:15:33 UTC
Red Hat Issue Tracker WFLY-9035 0 Major Resolved TransactionAttribute annotation is inherited from interface which not according to the spec 2018-02-28 05:15:32 UTC
Red Hat Knowledge Base (Solution) 3100771 0 None None None 2017-06-30 17:32:33 UTC

Description wfink 2017-06-30 17:31:09 UTC
Description of problem:


The annotation @TransactionAttribute is inherited from the business interface which is not according to the EJB specification.
Any annotation on the bean's implemenation class or deployment descriptor is overridden if the Interface is annotated with @TransactionAttribute

The EJB 3.2 specification chapter 8.3.7 says
"For a session bean written to the EJB 3.x client view API, the transaction attributes are speci-
fied for those methods of the session bean class that correspond to the bean’s business inter-
face"
Also the Javadoc for TransactionAttribute (http://docs.oracle.com/javaee/7/api/javax/ejb/TransactionAttribute.html) mention the bean class only.



How reproducible:


Simple Bean implementation

@Stateless
public class AnnotatedTxBean implements AnnotatedTx {
private static final Logger log = Logger.getLogger(AnnotatedTxBean.class);
@Resource
SessionContext context;

@TransactionAttribute(TransactionAttributeType.REQUIRED) // this is also the default
public void checkRollbackForDefaultRequired()
{ log.info("Now checking rollback"); log.info("RollbackOnly is '" + context.getRollbackOnly() + "'"); }

}

Interface:
public interface AnnotatedTx
{ @TransactionAttribute(TransactionAttributeType.NEVER) void checkRollbackForDefaultRequired(); }

The invocation will fail with:
ERROR [org.jboss.as.ejb3.invocation] (EJB default - 1) JBAS014134: EJB Invocation failed on component AnnotatedTxBean for method public abstract void org.jboss.wfink.ejb31.timer.AnnotatedTx.checkRollbackForDefaultRequired(): javax.ejb.EJBException: JBAS014163: Transaction present on server in Never call (EJB3 13.6.2.6)

and work if the annotation on interface level is removed

Comment 1 Radovan STANCEL 2017-08-21 10:29:06 UTC
PR: https://github.com/jbossas/jboss-eap/pull/3045


Note You need to log in before you can comment on or make changes to this bug.