[
https://issues.apache.org/jira/browse/DELTASPIKE-940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15110810#comment-15110810
]
Thomas Hug commented on DELTASPIKE-940:
---------------------------------------
The main reason to use a resolver approach in the Data module was that there is
a similar approach in the JSF module (MessageResolver AFAIR) so to stick to
this also in the JPA module would be overall consistent.
Another disadvantage of {{@Transactional(qualifier = ...}} is that a qualifier
is limited to an annotation type. A "proper" qualifier could also include
arguments, e.g. {{@MyDB(DbSchema.CUSTOMER)}} which wouldn't work with this
approach.
Anything speaking against moving {{EntityManagerResolver}} into the JPA module?
> @Transactional and @EntityManagerConfig each use a different method to
> resolve EntityManagers
> ---------------------------------------------------------------------------------------------
>
> Key: DELTASPIKE-940
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-940
> Project: DeltaSpike
> Issue Type: Improvement
> Components: Data-Module, JPA-Module
> Reporter: Xavier Dury
> Assignee: Thomas Hug
> Priority: Minor
>
> When an application uses multiple {{EntityManager}}'s, there must be a way to
> specify which one(s) should be used. Currently, {{@Transactional}} and
> {{@EntityManagerConfig}} use different approaches:
> - {{@Transactional}} can take one or more qualifiers directly in its
> {{qualifier()}} member ({{@Transactional(qualifier = MyDB.class)}})
> - While {{@EntityManagerConfig}} must define an {{EntityManagerResolver}}
> ({{@EntityManagerConfig(entityManagerResolver =
> MyDBEntityManagerResolver.class}})
> I think both should be unified and use a single way to specify which
> {{EntityManager}} to use. IMHO, the {{@Transactional}} way of doing looks
> better and should be applied to {{@EntityManagerConfig}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)