You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Ekin Sokmen (JIRA)" <ji...@apache.org> on 2007/08/24 14:17:31 UTC

[jira] Created: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

ManyToMany relationship not handled properly while using DataCache.
-------------------------------------------------------------------

                 Key: OPENJPA-333
                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
             Project: OpenJPA
          Issue Type: Bug
          Components: datacache
    Affects Versions: 1.0.0
         Environment: Linux Fedora 6 2.6.22.1-32.fc6
Java SE 1.5.0_11
            Reporter: Ekin Sokmen
             Fix For: 0.9.0


We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.

Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 

If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.

As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 


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


[jira] Updated: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

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

Ekin Sokmen updated OPENJPA-333:
--------------------------------

    Attachment: testcase.zip

Test case for this issue.

> ManyToMany relationship not handled properly while using DataCache.
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-333
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 1.0.0
>         Environment: Linux Fedora 6 2.6.22.1-32.fc6
> Java SE 1.5.0_11
>            Reporter: Ekin Sokmen
>         Attachments: testcase.zip
>
>
> We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.
> Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 
> If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.
> As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 

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


[jira] Updated: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

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

Ekin Sokmen updated OPENJPA-333:
--------------------------------

    Attachment: error_results.zip

Output of test results with assert exception.

> ManyToMany relationship not handled properly while using DataCache.
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-333
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 1.0.0
>         Environment: Linux Fedora 6 2.6.22.1-32.fc6
> Java SE 1.5.0_11
>            Reporter: Ekin Sokmen
>         Attachments: error_results.zip, JIRA333Success.doc, testcase.zip
>
>
> We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.
> Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 
> If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.
> As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 

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


[jira] Updated: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

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

Daniel Lee updated OPENJPA-333:
-------------------------------

    Attachment: JIRA333Success.doc

The testcase seems to be running okay on the latest revision (OpenJPA1.1 trunk 570948).  I'm not sure if I've missed anything but attached here is the output of running the testcases.  Which level of the build were you using?

> ManyToMany relationship not handled properly while using DataCache.
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-333
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 1.0.0
>         Environment: Linux Fedora 6 2.6.22.1-32.fc6
> Java SE 1.5.0_11
>            Reporter: Ekin Sokmen
>         Attachments: JIRA333Success.doc, testcase.zip
>
>
> We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.
> Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 
> If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.
> As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 

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


[jira] Updated: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

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

Ekin Sokmen updated OPENJPA-333:
--------------------------------

    Affects Version/s: 1.1.0

Updated affected versions of this issue. Tested same test case with following revisions without success : 550774, 570948, 574997.

> ManyToMany relationship not handled properly while using DataCache.
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-333
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 1.0.0, 1.1.0
>         Environment: Linux Fedora 6 2.6.22.1-32.fc6
> Java SE 1.5.0_11
>            Reporter: Ekin Sokmen
>         Attachments: error_results.zip, JIRA333Success.doc, testcase.zip
>
>
> We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.
> Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 
> If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.
> As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 

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


[jira] Updated: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

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

Ekin Sokmen updated OPENJPA-333:
--------------------------------

    Fix Version/s:     (was: 0.9.0)

> ManyToMany relationship not handled properly while using DataCache.
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-333
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 1.0.0
>         Environment: Linux Fedora 6 2.6.22.1-32.fc6
> Java SE 1.5.0_11
>            Reporter: Ekin Sokmen
>         Attachments: testcase.zip
>
>
> We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.
> Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 
> If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.
> As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 

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


[jira] Commented: (OPENJPA-333) ManyToMany relationship not handled properly while using DataCache.

Posted by "Ekin Sokmen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527068 ] 

Ekin Sokmen commented on OPENJPA-333:
-------------------------------------

Initially I was working with rev. 550774. After your comment I checked out the HEAD revision (574997) and also revision 570948. After running the test on both revisions we have still the same problem. The output is attached. 
(I'm starting the test using the command: [openjpa-persistence-jdbc]$ mvn test -Dtest=TestCachedJoin)

> ManyToMany relationship not handled properly while using DataCache.
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-333
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-333
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache
>    Affects Versions: 1.0.0
>         Environment: Linux Fedora 6 2.6.22.1-32.fc6
> Java SE 1.5.0_11
>            Reporter: Ekin Sokmen
>         Attachments: error_results.zip, JIRA333Success.doc, testcase.zip
>
>
> We are implementing WS-methods using POJOs and OpenJPA. Following description is a simplified model of the issue we are facing. There is also a test case attached which demonstrates the described problem.
> Assume that we have 2 entities EntityA and EntityB in ManyToMany relationship. We are going to create a new instance of EntityA and add an existing instance of EntityB to it. We are creating a new POJO instance of EntityA and add a fully populated offline instance of EntityB to it. This instance of EntityA is serialized and sent to the server where we are just doing "persist" on this entity. Without DataCache this is working fine. 
> If we enable DataCache and create a new instance of EntityA as described above the entity is persisted successfully but if we retrieve the instance using OpenJPA we get the instance of EntityA but the list of EntityB is not populated properly, which means we have a set of EntityB which is not null and the size is >0 but the content is just null.
> As a hint: if we debug the code we end up just after commit of new instance where the cache is updated. The enhanced method "pcFetchObjectId" of EntityB is called but the EntityB is a detached object so it returns null and the list of EntityB in EntityA consists of a list of nulls. 

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