Bug 1015145

Summary: [Doc Bug Fix] Document how to assign a transaction timeout to EJBs
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jan Martiska <jmartisk>
Component: DocumentationAssignee: Nidhi <nchaudha>
Status: CLOSED DUPLICATE QA Contact: Russell Dickenson <rdickens>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: dmichael, smumford
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1243420 (view as bug list) Environment:
Build Name: 14875, Development Guide-6.2-1 Build Date: 02-10-2013 13:20:00 Topic ID: 4527-299121 [Latest]
Last Closed: 2015-08-13 09:44:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jan Martiska 2013-10-03 14:04:34 UTC
Describe the issue:
JBoss-specific extensions to the EJB 3.1 specification should be documented. There is for example the possibility to assign an EJB a particular transaction timeout.

Suggestions for improvement:
Add instructions how to assign a transaction timeout. It is done through the @org.jboss.ejb3.annotation.TransactionTimeout annotation, which can be added either to an EJB class (then it applies to all its methods), or a method (then it applies to this method only and overrides the effect of a @TransactionTimeout added to a class). Also, this only works for EJBs which use Container-managed transactions. Example:

@Stateless
@TransactionTimeout(value = 5, unit = TimeUnit.SECONDS)
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class HelloBean implements HelloBeanRemote {

    @TransactionTimeout(value = 1, unit = TimeUnit.SECONDS)
    public String method1() {
        return "This method must not take more than 1 second";
    }

    public String method1() {
        return "This method must not take more than 5 seconds";
    }

}

Also please mention that the @TransactionTimeout annotation is part of the JBoss EJB3 external API and must be added as a dependency, with Maven you can do it this way:

<dependency>
  <groupId>org.jboss.ejb3</groupId>
  <artifactId>jboss-ejb3-ext-api</artifactId>
  <version>2.1.0</version>
</dependency>

Comment 3 Nidhi 2015-08-13 09:44:11 UTC

*** This bug has been marked as a duplicate of bug 1139905 ***