[
http://jira.jboss.com/jira/browse/JBAS-3873?page=all ]
Darran Lofthouse reopened JBAS-3873:
------------------------------------
In section 17.6.2.3 the spec also states : -
The Supports transaction attribute must be used with caution. This is because of the
different transactional
semantics provided by the two possible modes of execution. Only the enterprise beans that
will
execute correctly in both modes should use the Supports transaction attribute.
This clarifies that the bean implementation needs to be implemented to cope with both
modes of execution.
Then section 17.6.2.8 states: -
The container must throw the java.lang.IllegalStateException if the EJBContext.
setRollbackOnly method is invoked from a business method executing with the Supports,
NotSupported, or Never transaction attribute.
The third word of this sentence is 'must' so this is not optional.
Actually 17.6.2.3 says "If the client calls with a transaction context, the container
performs the same steps as described
in the Required case."
The steps for Required are described in section 17.6.2.2: -
"The container must invoke an enterprise bean method whose transaction attribute is
set to Required
with a valid transaction context.
If a client invokes the enterprise bean's method while the client is associated with a
transaction context,
the container invokes the enterprise bean's method in the client's transaction
context.
If the client invokes the enterprise bean's method while the client is not associated
with a transaction
context, the container automatically starts a new transaction before delegating a method
call to the
enterprise bean business method. The container automatically enlists all the resource
managers accessed
by the business method with the transaction. If the business method invokes other
enterprise beans, the
container passes the transaction context with the invocation. The container attempts to
commit the transaction
when the business method has completed. The container performs the commit protocol before
the
method result is sent to the client."
At no point do these steps mention anything that conflicts with the statement in 17.6.2.3
- the steps that Supports must follow are just about transaction propagation, calling
setRollbackOnly is handled in it's own section of the spec.
EJB 2.1 - 17.6.2.8 - setRollbackOnly must throw IllegalStateException
when called from EJB with transaction attribute of Supports, NotSupported or Never
--------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBAS-3873
URL:
http://jira.jboss.com/jira/browse/JBAS-3873
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: EJB2
Affects Versions: JBossAS-4.0.5.GA
Reporter: Darran Lofthouse
Assigned To: Dimitris Andreadis
Fix For: JBossAS-4.2.0.CR1
EJB 2.1 - 17.6.2.8 - setRollbackOnly must throw IllegalStateException when called from
EJB with transaction attribute of Supports, NotSupported or Never.
However for an EJB with a transaction attribute of Supports if it is called with a
transaction calls to setRollbackOnly succeed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira