[jboss-jira] [JBoss JIRA] Commented: (JBAS-3873) EJB 2.1 - 17.6.2.8 - setRollbackOnly must throw IllegalStateException when called from EJB with transaction attribute of Supports, NotSupported or Never

Darran Lofthouse (JIRA) jira-events at jboss.com
Fri Jan 26 17:55:57 EST 2007


    [ http://jira.jboss.com/jira/browse/JBAS-3873?page=comments#action_12351759 ] 
            
Darran Lofthouse commented on JBAS-3873:
----------------------------------------

The first link the generated Javadoc just states that the method will throw an IllegalStateException if the method is not allowed to be called, the spec then contains clarifications on when it can not be called.

The second link just appears to be someone commenting on a Manning publication, his arguments do not seem to be based on anything specific.  He is quoting that their publication says 'unspecified transaction context', this is correct - if you specify 'Supports' as the transaction attribute then the transaction context of the bean is unspecified - when the bean is called the transaction may or may not exist so technically it is not specified.  If you say Required, RequiresNew or Mandatory you are guaranteed a transaction so the transaction context is specified.

And the third post shows this problem has existed for a long time in JBoss, the basis of their discussion is some trial and error, their final solution is a workaround based on the current implementation.

If the spec intended that a bean should be able to call setRollbackOnly for some scenarios when Supports has been specified there would have been a method available to see if there is a transaction - a CMT bean is not allowed to query the status of the transaction other than getRollbackOnly (Which also throws the same IllegalStateException).
 

> 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

        



More information about the jboss-jira mailing list