]
jaikiran pai reassigned WFLY-1496:
----------------------------------
Assignee: Stefano Maestri (was: jaikiran pai)
{quote}
at
org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:247)
{quote}
It looks like the WrapperDataSource uses UserTransaction for the sake of checking a
transaction status. The EE spec states that the UserTransaction isn't supposed to be
allowed access for certain invocation (like the one above). If the WrapperDataSource
really needs to just check the transaction status then it can use the
TransactionSynchronizationRegistry instead
.
The application server makes the TransactionSynchronizationRegistry available under
(vendor specific) java:jboss/TransactionSynchronizationRegistry JNDI name. The other way
would be to just use some internal transaction manager API to check the status.
@Transactional doesn't work
---------------------------
Key: WFLY-1496
URL:
https://issues.jboss.org/browse/WFLY-1496
Project: WildFly
Issue Type: Bug
Components: 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: