Bug 1466909 - TransactionAttribute annotation is inherited from interface which not according to the spec
TransactionAttribute annotation is inherited from interface which not accordi...
Status: POST
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB (Show other bugs)
6.4.14
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Radovan STANCEL
Jiří Bílek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-30 13:31 EDT by wfink
Modified: 2017-08-21 06:32 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEAP-11909 Major Pull Request Sent [7.0.z] TransactionAttribute annotation is inherited from interface which not according to the spec 2018-02-27 11:52 EST
JBoss Issue Tracker JBEAP-11910 Major Pull Request Sent [7.1.z] TransactionAttribute annotation is inherited from interface which not according to the spec 2018-02-28 00:15 EST
JBoss Issue Tracker WFLY-9035 Major Resolved TransactionAttribute annotation is inherited from interface which not according to the spec 2018-02-28 00:15 EST
Red Hat Knowledge Base (Solution) 3100771 None None None 2017-06-30 13:32 EDT

  None (edit)
Description wfink 2017-06-30 13:31:09 EDT
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 06:29:06 EDT
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.