You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Dianne Richards (JIRA)" <ji...@apache.org> on 2010/07/12 20:03:51 UTC

[jira] Created: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Problem serializing DistinctResultList when EntityManager is closed
-------------------------------------------------------------------

                 Key: OPENJPA-1722
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 2.1.0
            Reporter: Dianne Richards
            Assignee: Dianne Richards
             Fix For: 2.1.0


A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.

Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.

The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.

So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Posted by "Dianne Richards (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on OPENJPA-1722 started by Dianne Richards.

> Problem serializing DistinctResultList when EntityManager is closed
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-1722
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.1.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.1.0
>
>
> A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.
> Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.
> The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.
> So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12888920#action_12888920 ] 

Michael Dick commented on OPENJPA-1722:
---------------------------------------

Thanks, take a look at org.apache.openjpa.lib.test.AbstractTestCase.roundtrip(Object, boolean) - to serialize the resultList. 

>From your description it should just be a matter of closing the EM and then serializing and verifying that the resultlist is accurate. 

> Problem serializing DistinctResultList when EntityManager is closed
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-1722
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.1.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.1.0
>
>
> A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.
> Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.
> The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.
> So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dick updated OPENJPA-1722:
----------------------------------

        Fix Version/s: 2.0.1
    Affects Version/s: 2.0.0
                           (was: 2.1.0)

> Problem serializing DistinctResultList when EntityManager is closed
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-1722
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.0.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.0.1, 2.1.0
>
>
> A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.
> Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.
> The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.
> So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887918#action_12887918 ] 

Michael Dick commented on OPENJPA-1722:
---------------------------------------

Hi Dianne, do you have a unit test for this change? 

> Problem serializing DistinctResultList when EntityManager is closed
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-1722
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.1.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.1.0
>
>
> A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.
> Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.
> The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.
> So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Posted by "Dianne Richards (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12888845#action_12888845 ] 

Dianne Richards commented on OPENJPA-1722:
------------------------------------------

Hi Mike - I'm trying to figure one out, if it's possible.

> Problem serializing DistinctResultList when EntityManager is closed
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-1722
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.1.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.1.0
>
>
> A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.
> Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.
> The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.
> So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods resolved OPENJPA-1722.
-----------------------------------

    Resolution: Fixed

> Problem serializing DistinctResultList when EntityManager is closed
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-1722
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1722
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.0.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.0.1, 2.1.0
>
>
> A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed.
> Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception.
> The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object.
> So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.