openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christiaan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-453) Evicting embedded object nullifies statemanager
Date Fri, 29 May 2009 11:16:45 GMT

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

Christiaan commented on OPENJPA-453:
------------------------------------

I think two issues combined in this issue:
1) Whether the sm should be nullified on evict or commit or not. This has some implications
and is under discussion as Craig mentions for jdo. 

2) A NullpointerException is thrown in OpenJPA code. Whatever the decision for item 1 I don't
think this nullpointer should be thrown. It occurs for the following scenario where one thread
is accessing an embedded object (object is instantiated and the fields need to be loaded from
the datastore and another thread is doing a commit and wants to nullify the statemanager of
the embedded object:
Thread1 (Accessing an embedded object)
==========
getEmbeddedObject() => load fields from datastore:
org.apache.openjpa.kernel.StateManagerImpl.replaceField(StateManagerImpl.java:2872) 
stop here

Thread2
=======
perform a commit => sm is nullified
now continue with Thread1

So instantiating and loading the fields of the embedded should probably be one atomic action.
(or fields should be left null if the statemanager is already nullified).

Ravi, I think you have attached the wrong testcase. The link in your comment is right testcase.

kind regards,
Christiaan

> Evicting embedded object nullifies statemanager
> -----------------------------------------------
>
>                 Key: OPENJPA-453
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-453
>             Project: OpenJPA
>          Issue Type: Bug
>         Environment: Kodo 4.1.4, Ms sql server 2005, jTDS 1.2, jdk 1.6
>            Reporter: Christiaan
>         Attachments: openJPATestCase.zip, TestCaseEvictEmbedded.zip
>
>
> I am noticing the following behaviour: If evict() is called on an embedded
> object the statemanager is nullified which is in contrast to non-embedded
> objects. Subsequently, calling JDOHelper.getPersistenceManager() on the
> evicted embedded object returns null. Is this the correct behaviour?

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


Mime
View raw message