tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-2027) EntityManagerObjectProvider always provides the initial EntityManger proxy created
Date Tue, 15 Mar 2016 08:02:33 GMT

    [ https://issues.apache.org/jira/browse/TAP5-2027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15194885#comment-15194885
] 

Hudson commented on TAP5-2027:
------------------------------

FAILURE: Integrated in tapestry-trunk-freestyle #1564 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/1564/])
FIXED - TAP5-2027: EntityManagerObjectProvider always provides the (kaosko: rev 0acf94ae073b321ec8579092c0324745ff235c05)
* tapestry-jpa/src/main/java/org/apache/tapestry5/internal/jpa/EntityManagerObjectProvider.java


> EntityManagerObjectProvider always provides the initial EntityManger proxy created
> ----------------------------------------------------------------------------------
>
>                 Key: TAP5-2027
>                 URL: https://issues.apache.org/jira/browse/TAP5-2027
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-jpa
>    Affects Versions: 5.3.5, 5.3.6, 5.4
>            Reporter: John Coleman
>            Assignee: Kalle Korhonen
>             Fix For: 5.4.1
>
>         Attachments: TapestryJPATest.zip
>
>
> When persistence.xml defines multiple persistence units, classes injecting EntityManager
with @PersistenceContext(unitName=value  crash because the entities associated with the PU
in configuration are not recognised at runtime.
> By placing trace in the code I established that the first EntityManager injected gets
injected to all my other service classes even though I use different unitName= annotations.
> The EntityManagerObjectProvider class contains a class variable proxy and works like
a singleton always injecting the first EntityManager proxy class created for any later EntityManager
injections.
> The following code fixes the issue and is provided as-is, free and without copyright
or warranty. This is more like a refactor because I have also replaced some depricated code.
As a patch it also works just to remove the proxy class member variable and the if (proxy
== null) condition.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message