[Fwd: [Bug 248999] 17 JPA tests fail while running against GlassFish]

View: New views
3 Messages — Rating Filter:   Alert me  

[Fwd: [Bug 248999] 17 JPA tests fail while running against GlassFish]

by Darani Yallapragada :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please do review the patch for Bug#248999 and let me know if any changes
are supposed to be  made.

Darani

https://bugs.eclipse.org/bugs/show_bug.cgi?id=248999 
Product/Component: EclipseLink / JPA




--- Comment #1 from Darani Yallapragada <darani.yallapragada@...>  2008-09-29 14:56:54 -0400 ---
Created an attachment (id=113788)
 --> (https://bugs.eclipse.org/bugs/attachment.cgi?id=113788)
FixForBug 248999

The attachment is the diff of "EntityManagerTestSuite.java" in which the
queries (deleteQuery) are defined within the transaction in these two methods
"testFindDeleteAllPersist()" and
"internalTestReadTransactionIsolation(boolean shouldOriginalBeInParentCache,
boolean shouldUpdateAll, boolean shouldRefresh, boolean shouldFlush)"


--
Configure bugmail: https://bugs.eclipse.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You reported the bug.

_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

Re: [Fwd: [Bug 248999] 17 JPA tests fail while running against GlassFish]

by Christopher Delahunt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Darani,

Test changes look fine, but for me, more needs to go into the bug
explanation and why these changes are necessary.  From the exceptions
thrown from the tests in question, Glassfish seems to be wrapping
queries in a proxy and then throwing an exception when they get executed
- regardless of the EntityManager they are associated to being in a
transaction or not.  The specification seems to state that the context
needs to be in a transaction when the query executes, not when the query
is created - otherwise why not throw the exception straight away when an
update query is created.  To me, this seems like be a bug in the
glassfish proxy, not in the tests.  Am I missing something?


Best Regards,
Chris



Darani Yallapragada wrote:

> Please do review the patch for Bug#248999 and let me know if any
> changes are supposed to be  made.
>
> Darani
>
> ------------------------------------------------------------------------
>
> Subject:
> [Bug 248999] 17 JPA tests fail while running against GlassFish
> From:
> bugzilla-daemon@...
> Date:
> Mon, 29 Sep 2008 14:56:51 -0400 (EDT)
> To:
> Darani.Yallapragada@...
>
> To:
> Darani.Yallapragada@...
>
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248999 
> Product/Component: EclipseLink / JPA
>
>
>
>
> --- Comment #1 from Darani Yallapragada <darani.yallapragada@...>  2008-09-29 14:56:54 -0400 ---
> Created an attachment (id=113788)
>  --> (https://bugs.eclipse.org/bugs/attachment.cgi?id=113788)
> FixForBug 248999
>
> The attachment is the diff of "EntityManagerTestSuite.java" in which the
> queries (deleteQuery) are defined within the transaction in these two methods
> "testFindDeleteAllPersist()" and
> "internalTestReadTransactionIsolation(boolean shouldOriginalBeInParentCache,
> boolean shouldUpdateAll, boolean shouldRefresh, boolean shouldFlush)"
>
>
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> eclipselink-dev mailing list
> eclipselink-dev@...
> https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
>  
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

RE: [Fwd: [Bug 248999] 17 JPA tests fail while running against GlassFish]

by mobrien :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Darani,
   Your change looks good to me - thank you, does it run OK.

Line 1676-1687
- So that we are inside a transaction you,
  reversed the order of em.createQuery("DELETE..."); and beginTransaction(em)
  to em.beginTransaction; em.createQuery("..

- The rest of the change moved all em.beginTransaction and em.createQuery calls inside the try/catch blocks


Q) You mention 2 places where the order of beginTransaction and createQuery was reversed for the fix - I only find one in the diff in internalTestReadTransactionIsolation()
Also the latest version of the build looks to be already fixed for both instances.
I see the following in the build (rev 2450) - it looks like it has already been fixed after your diff was generated.

    protected void internalTestReadTransactionIsolation(boolean shouldOriginalBeInParentCache, boolean shouldUpdateAll, boolean shouldRefresh, boolean shouldFlush) {
        //setup
        String firstName = "testReadTransactionIsolation";
       
        // make sure no Employee with the specified firstName exists.
        EntityManager em = createEntityManager("fieldaccess");
        beginTransaction(em);
        try{
            em.createQuery("DELETE FROM Employee e WHERE e.firstName = '"+firstName+"'").executeUpdate();
            commitTransaction(em);

-----Original Message-----
From: Darani Yallapragada [mailto:Darani.Yallapragada@...]
Sent: Monday, September 29, 2008 15:02
To: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] [Fwd: [Bug 248999] 17 JPA tests fail while
running against GlassFish]


Please do review the patch for Bug#248999 and let me know if any changes
are supposed to be  made.

Darani
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
LightInTheBox - Buy quality products at wholesale price!