Frank Jung created TOMEE-2907:
---------------------------------
Summary: Transaction not marked RollbackOnly when @Transactional
annotated via @Stereotype
Key: TOMEE-2907
URL: https://issues.apache.org/jira/browse/TOMEE-2907
Project: TomEE
Issue Type: Bug
Components: TomEE Core Server
Affects Versions: 8.0.4
Reporter: Frank Jung
Attachments: TransStereoDemo.zip
When annotating a bean method (or its class) with @Transactional, the
transaction is marked RollbackOnly if a RuntimeException is thrown.
This is not working when wrapping @Transactional into a @Stereotype and using
this to mark as transactional.
Tiny sample project to demonstrate the problem will be attached - call the
following URLs after deployment:
[1]
[http://localhost:8080/TransStereoDemo/demo/success|http://localhost:8080/TransStereoDemo/demo/fail]
[2] [http://localhost:8080/TransStereoDemo/demo/fail]
[3]
[http://localhost:8080/TransStereoDemo/demo/success2|http://localhost:8080/TransStereoDemo/demo/fail]
[4] [http://localhost:8080/TransStereoDemo/demo/fail2]
All above calls will output "COMMIT" or "ROLLBACK" depending on the transaction
state.
[2] will correctly result in "ROLLBACK" (@Transactional annotated directly)
while [4] gives "COMMIT" (@Stereotype containing @Transactional is used for
annotation)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)