[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-4278) @Create methods on @Startup components are called without a transaction
Norman Richards (JIRA)
jira-events at lists.jboss.org
Tue Jul 7 10:58:51 EDT 2009
[ https://jira.jboss.org/jira/browse/JBSEAM-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12475224#action_12475224 ]
Norman Richards commented on JBSEAM-4278:
-----------------------------------------
This is a javabean component, not an EJB. TX management must be explicitly requested if needed. Seam happens to normally provide a TX for all HTTP requests, so it really only becomes critical to declare when you are not using seam-manged transactions or are working (as in this case) outside the scope of where you might happen to be in a TX already. App startup is such a case. This would be different for an EJB, where the expectation is that all invocations at any time would have a TX around it by default.
> @Create methods on @Startup components are called without a transaction
> -----------------------------------------------------------------------
>
> Key: JBSEAM-4278
> URL: https://jira.jboss.org/jira/browse/JBSEAM-4278
> Project: Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.2.0.CR1
> Reporter: Sanne Grinovero
> Fix For: 2.2.0.GA
>
>
> Having a component annotated with @Scope(ScopeType.APPLICATION) and @Startup having a @Create method to do something at application startup is called correctly but there is no transaction around the method. (i.e. changes done trough an EntityManager are never applied)
> The transaction is created and committed if the component is a Stateful EJB, but in this case @In injection is not working.
> This breaks for example the Blog example's test as it rebuilds the initial Lucene index using this method.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list