[
https://issues.apache.org/jira/browse/DELTASPIKE-940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16013081#comment-16013081
]
Mark Struberg commented on DELTASPIKE-940:
------------------------------------------
---
deltaspike/modules/jpa/api/src/main/java/org/apache/deltaspike/jpa/api/transaction/Transactional.java
(revision 0cdede08c07b0ed791b9018e1ea5281b690728ae)
+++
deltaspike/modules/jpa/api/src/main/java/org/apache/deltaspike/jpa/api/transaction/Transactional.java
(revision )
@@ -58,8 +58,12 @@
* {@link javax.persistence.EntityManager}s with qualifiers in a called
method (of a different bean)
* which isn't {@link Transactional} itself.
*
+ * This method is now deprecated, and if you have multiple {@link
javax.persistence.EntityManager}s you should use
+ * {@link
org.apache.deltaspike.jpa.api.entitymanager.EntityManagerResolver}
+ *
* @return target persistence-unit identifier
*/
+ @Deprecated
@Nonbinding Class<? extends Annotation>[] qualifier() default Any.class;
as explained, the qualifier makes sense and is used by various projects.
> @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: John D. Ament
> Priority: Minor
> Fix For: 1.8.1
>
> Attachments: ds940.patch
>
>
> 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.15#6346)