You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Timothy Ward (JIRA)" <ji...@apache.org> on 2010/05/26 18:05:35 UTC

[jira] Commented: (ARIES-322) Anonymous beans in blueprint incompatible with JPA integration

    [ https://issues.apache.org/jira/browse/ARIES-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12871784#action_12871784 ] 

Timothy Ward commented on ARIES-322:
------------------------------------

This actually looks like a problem with the declarative transactions runtime rather than the JPA container. I assume that the bean has a <jpa:context .../> injection annotation, and that the injected EntityManager is being accessed outside of a JTA transaction. The TransactionRequiredException is then the correct specified behaviour, but there should be a transaction set up by the <tx:transaction .../> element

> Anonymous beans in blueprint incompatible with JPA integration
> --------------------------------------------------------------
>
>                 Key: ARIES-322
>                 URL: https://issues.apache.org/jira/browse/ARIES-322
>             Project: Aries
>          Issue Type: Bug
>            Reporter: Holly Cummins
>
> If I change the blueprint.xml for the JPA bundle of the blog sample to the following, 
>  <service  interface="com.ibm.ws.eba.example.blog.persistence.api.BlogPersistenceService">
>    <bean class="com.ibm.ws.eba.example.blog.persistence.BlogPersistenceServiceImpl">
>      <tx:transaction method="*" value="Required"/>
>    </bean>
>  </service>
> the samples fails with this error:
> [25/05/10 17:35:59:068 BST] 0000002c servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet Edit Blog Author in application 55f218ea-219d-4ff1-af48-3b80c274765b.2. Exception created : javax.persistence.TransactionRequiredException: No transaction currently active
> 	at org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext(JTAPersistenceContextRegistry.java:94)
> 	at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext (JTAEntityManager.java:73)
>        at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.persist(JTAEntityManager.java:220)
> The problem seems to be the anonymous bean. This tripped me up pretty badly when I was trying to write a new application, and I expect other users would hit it as well. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.