[
https://issues.jboss.org/browse/CDI-213?page=com.atlassian.jira.plugin.sy...
]
Pete Muir commented on CDI-213:
-------------------------------
Tom Jenkinson says
{quote}
Would it make sense to maintain the same restrictions as JMS?
In JMS you can initiate a new transaction from onMessage, analogous to a method decorated
with @Observes. If the method returns without completing the transaction then an error is
logged and the transaction rolled back.
Flowing a transaction from an event producer to an event consumer isn't a great idea
(it doesn't work in JMS either). But allowing a consumer to control their own
transaction does seem to make sense to me.
Admittedly this is a gut reaction, I read through the Jira and the doc you linked to
though, and used my JEE experience to draw analogies, do let me know if I got the wrong
end of the stick please!
{quote}
So it sounds like it's sensible to specify as non-portable, as people might want to
experiment with this.
I'll raise a new issue for TBD to consider specifying how TX control works in observer
methods.
Specify what happens if an observer method does directly initiate,
commit or rollback JTA transaction
-----------------------------------------------------------------------------------------------------
Key: CDI-213
URL:
https://issues.jboss.org/browse/CDI-213
Project: CDI Specification Issues
Issue Type: Clarification
Components: Events, Java EE integration
Reporter: Martin Kouba
Priority: Minor
Fix For: 1.1 (Proposed)
At the moment, the specification does not really specify what happens if an observer
method does directly initiate, commit or rollback JTA transaction.
See *10.5. Observer notification*: "An observer method may not directly initiate,
commit or rollback JTA transactions."
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira