[jboss-jira] [JBoss JIRA] (WFLY-1496) @Transactional doesn't work

Paul Robinson (JIRA) jira-events at lists.jboss.org
Tue Jun 25 12:40:21 EDT 2013


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

Paul Robinson commented on WFLY-1496:
-------------------------------------

Thanks Jaikiran,

Yes, this is expected behaviour from the JTA 1.2 code. Looks like we need a fix for WrapperDataSource.
                
> @Transactional doesn't work
> ---------------------------
>
>                 Key: WFLY-1496
>                 URL: https://issues.jboss.org/browse/WFLY-1496
>             Project: WildFly
>          Issue Type: Bug
>          Components: JCA, Transactions
>    Affects Versions: 8.0.0.Alpha2
>            Reporter: Juergen Zimmermann
>            Assignee: Stefano Maestri
>         Attachments: testcase-WFLY-1496.zip
>
>
> I just tried the WildFly Alpha 2 snapshot containing Narayana 5.0.0.M3 and get the error message below. The classes causing the error are:
> @Path("/bestellungen")
> @Produces({ APPLICATION_JSON, APPLICATION_XML })
> //@RequestScoped is default for JAX-RS
> @Transactional
> public class BestellungResource {
> @Inject
> private BestellungService bs;
> ...
> }
> @Transactional(TxType.MANDATORY)
> public class BestellungServiceImpl implements Serializable {
> 	private static final long serialVersionUID = ...L;
> 	
> 	@PersistenceContext
> 	private transient EntityManager em;
> // method invoking JPA / Hibernate
> }
> The fragment of server.log:
> 15:11:43,254 DEBUG [org.hibernate.SQL] 
>     /* named HQL query Bestellung.findKundeById */ select
>         distinct abstractku1_.id as id2_8_,
>         abstractku1_.aktualisiert as aktualis3_8_,
>         abstractku1_.bemerkungen as bemerkun4_8_,
>         abstractku1_.email as email5_8_,
>         abstractku1_.erzeugt as erzeugt6_8_,
>         abstractku1_.file_fk as file18_8_,
>         abstractku1_.kategorie as kategori7_8_,
>         abstractku1_.nachname as nachname8_8_,
>         abstractku1_.newsletter as newslett9_8_,
>         abstractku1_.password as passwor10_8_,
>         abstractku1_.rabatt as rabatt11_8_,
>         abstractku1_.seit as seit12_8_,
>         abstractku1_.umsatz as umsatz13_8_,
>         abstractku1_.version as version14_8_,
>         abstractku1_.vorname as vorname15_8_,
>         abstractku1_.familienstand_fk as familie16_8_,
>         abstractku1_.geschlecht_fk as geschle17_8_,
>         abstractku1_.art as art1_8_ 
>     from
>         Bestellung bestellung0_ 
>     inner join
>         kunde abstractku1_ 
>             on bestellung0_.kunde_fk=abstractku1_.id 
>     where
>         bestellung0_.id=?
> 15:11:43,254 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: null
> 15:11:43,254 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] UserTransaction is not available within the scope of a bean or method annotated with @Transactional and a Transactional.TxType other than NOT_SUPPORTED or NEVER

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list