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

Erik Kis commented on OPENJPA-2234:
-----------------------------------

Hello, Rick, thanks for your quick response.

Regarding persistence configuration, I've checked - getTransactionManager() 
method _is_ static.

Regarding problem assessment - I agree with you; I've actually noticed that 
Spring doesn't set the TransactionManager (PlatformTransactionManager's setter 
is not invoked), hence we get NPE@line 720. The problem happens while 
bootstrapping Spring application context - more specifically, while Spring Data 
JPA performs query lookup. Now, if you were to check comments in SO writeup, 
you'll notice that in correspondence with Oliver Gierke (Spring Data JPA 
project lead), he had stated that OpenJPA is actually not conforming here to 
JPA specification, since by JPA spec, no tx activity is needed during query 
creation (i.e. while executing entityManager.createQuery(...)).

As I said, I am far from understanding every nook and cranny in any of the 
participating modules (be it OpenJPA, Spring Data JPA or the JPA2 specification 
itself), however, his arguments do seem convincing, at least to me.

Is there anything else we could try?
                
> EntityManager instance creation needs TX activity
> -------------------------------------------------
>
>                 Key: OPENJPA-2234
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2234
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.1
>         Environment: - JDK 1.5
> - Spring 3.1.1.RELEASE
> - Spring Data JPA 1.1 GA (issue confirmed on version 1.0.3)
> - Atomikos 3.7.0
> - OpenJPA 2.0.1
> - DB2 9.7
>            Reporter: Erik Kis
>
> While working with Spring Data, we came across a potential bug in OpenJPA.
> The bug was provoked by a query lookup module in Spring Data JPA, but it has 
> its roots in AbstractBrokerFactory class, which seems to require transaction 
> existence in order to create EntityManager (which is contrary to JPA spec).
> I have already been in touch with Spring Data JPA author (where I filed a bug 
> against Spring Data JPA) who actually pointed me to file a bug here.
> I have extensively documented my findings on this thread 
> (http://stackoverflow.com/questions/10688040/spring-data-jpa-fails-to-invoke-jtatransactionmanager),
>  so I'll rather post the link, instead of repeating the whole thing here.
> All that being said, I am not entirely sure what actually happened and am no 
> authority whatsoever on JPA spec.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to