[jboss-jira] [JBoss JIRA] (WFLY-4608) Omit no-op transaction if lifecycle method is missing

Ivo Studensky (JIRA) issues at jboss.org
Thu Oct 22 09:03:00 EDT 2015


    [ https://issues.jboss.org/browse/WFLY-4608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121001#comment-13121001 ] 

Ivo Studensky commented on WFLY-4608:
-------------------------------------

The fix has been more or less rejected, but there is still an issue to answer. Thus, I am moving the discussion from github to this place.

Ivo Studensky wrote:
There still is a use-case which might violate the spec. If a Stateful/Singleton without any {{@PostConstruct}} method is annotated with a {{@Interceptor}} with its own {{@PostConstruct}} method and the bean is annotated with {{@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)}}, the post-construct method of the interceptor should be executed within a new transaction. In WildFly, however, it is executed as {{TransactionAttributeType.NOT_SUPPORTED}} because it is the default if LifecycleCMTTxInterceptor's factory is constructed with {{null}} method identifier. Note that it might be easily work-arounded by an empty post-construct method in the bean class.

Excerpt from the Interceptors 1.2 spec, section 2.6:
{quote}
Lifecycle callback interceptor methods are invoked in a transaction context determined by their target class and/or method \[5\].

\[5\] In general, such a lifecycle callback interceptor method will be invoked in an unspecified
transaction context. Note however that singleton and stateful session beans support the use of
a transaction context for the invocation of their lifecycle call interceptor methods (see the
Enterprise JavaBeansTM specification \[2\]). The transaction context may be also changed by
transactional interceptors in the invocation chain.
{quote}

> Omit no-op transaction if lifecycle method is missing
> -----------------------------------------------------
>
>                 Key: WFLY-4608
>                 URL: https://issues.jboss.org/browse/WFLY-4608
>             Project: WildFly
>          Issue Type: Bug
>          Components: EJB
>    Affects Versions: 9.0.0.CR1
>            Reporter: Ivo Studensky
>            Assignee: Ivo Studensky
>             Fix For: 10.0.0.CR4
>
>
> LifecycleCMTTxInterceptor creates a no-op transaction even if there is no lifecycle method defined in the bean. 



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list