db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: Lifecycle listener events concerning store/delete
Date Thu, 24 Nov 2005 08:49:03 GMT
Hi Craig,

I have attached a patch to JDO-166. The patch has neither been reviewed 
yet, nor has it been checked in yet. Shall I file a JIRA?

Regards,
Michael
> Hi,
> 
> It might be better to have this discussion attached to a JIRA issue.  Is 
> the test case checked in?
> 
> Craig
> 
> On Nov 23, 2005, at 2:56 AM, Michael Watzek wrote:
> 
>> Hi Andy,
>>
>> I'm implementing test cases for deletion by query. Assertion  A14.8-4 
>> specifies (amongst others) that dirty instances are flushed  to the 
>> datastore before they are deleted.
>>
>> The test case implementing this assertion adds a lifecycle listener  
>> to the persistence manager. The listener checks the order of events  
>> fired by JPOX. The test case fails if store events are fired after  
>> the first delete event was fired.
>>
>> JPOX fires the right order of events when instances are involved  not 
>> having any relationships. Involving instances having  relationships 
>> JPOX does not stick to that order.
>>
>> For example:
>>
>> The test case updates all employees. Afterwards, it deletes these  
>> employees using Query.deletePersistentAll inside the same  
>> transaction. If the test case uses employees having relationships,  it 
>> appears, that some store events are fired between preDelete and  
>> postDelete events fired on the same instance. On the other hand, if  
>> the test case uses employees without relationships the order of  
>> events meets the spec. Please have a look below.
>>
>> Is the different event handling concerning relationships intentional?
>>
>> Regards,
>> Michael
>>
>> Events fired on persons without relationships:
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 1
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 2
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 3
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 4
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 5
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 5
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 5
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 5
>>
>>
>> Events fired on persons with relationships:
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 5
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 5
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 1
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 2
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 3
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 4
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 5
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 1
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 2
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 3
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 4
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 5
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 1
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 3
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] preStore event: org.apache.jdo.tck.pc.company.Person$Oid: 4
>>     [java] postStore event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 2
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 3
>>     [java] preDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>>     [java] postDelete event: org.apache.jdo.tck.pc.company.Person $Oid: 4
>> -- 
>> -------------------------------------------------------------------
>> Michael Watzek                  Tech@Spree Engineering GmbH
>> mailto:mwa.tech@spree.de        Buelowstr. 66
>> Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
>> Fax.:  ++49/30/217 520 12       http://www.spree.de/
>> -------------------------------------------------------------------
> 
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 
> 


-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message