[
https://issues.apache.org/jira/browse/DELTASPIKE-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13917995#comment-13917995
]
Thomas Hug commented on DELTASPIKE-420:
---------------------------------------
Looks good, thnx [~gpetracek]. Will take care of it.
To summarize the current state of the issue:
- Methods on the EntityRepository interface or @Query annotated methods
requiring a transaction are detected by the data module and a TX is started if
not present. It uses the JPA-module TransactionStrategy - for JTA environments
this currently requires configuring the alternative (documentation to be
updated).
- Concrete query methods on repositories should in the future support
@Transactional as soon as PartialBeans support interceptors.
- Until then the suggestion for users is to create a repository extension for
concrete query methods - those extensions support @Transactional. A sample
implementation will be added to the documentation.
> Transactional repositories
> --------------------------
>
> Key: DELTASPIKE-420
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-420
> Project: DeltaSpike
> Issue Type: New Feature
> Components: Data-Module
> Affects Versions: 0.5
> Reporter: Harald Wellmann
> Assignee: Thomas Hug
> Attachments: DELTASPIKE-420_spi.patch
>
>
> It's nice to get semi-automatic repositories from DeltaSpike Data, but these
> repositories would be even more fun if they were transactional, not
> necessarily by default, but at least by simple configuration.
> Possible approaches:
> 1) Add @Transactional to an abstract repository class, i.e.
> javax.transaction.Transactional in Java EE 7, or
> org.apache.deltaspike.jpa.api.transaction.Transactional otherwise.
> Currently, this does not work due to DELTASPIKE-419.
> 2) Make it easy to override the @Repository binding or the query handler, to
> add transactional behaviour.
--
This message was sent by Atlassian JIRA
(v6.2#6252)