Bug 1015145 - [Doc Bug Fix] Document how to assign a transaction timeout to EJBs
[Doc Bug Fix] Document how to assign a transaction timeout to EJBs
Status: CLOSED DUPLICATE of bug 1139905
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Documentation (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Nidhi
Russell Dickenson
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-03 10:04 EDT by Jan Martiska
Modified: 2015-08-13 05:44 EDT (History)
2 users (show)

See Also:
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 05:44:11 EDT
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)

  None (edit)
Description Jan Martiska 2013-10-03 10:04:34 EDT
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 05:44:11 EDT

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

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