Michelle, Craig,

Martin Zaun wrote:

I'm currently going over the lifecycle spreadsheet, checking the
transition-related assertions for coverage by A5.9.1..190 and the
newly implemented cases, and preparing a few comments (which I'll
send to you soon).

Please, find attached a first batch of comments on the latest
spreadsheet's lifecycle tab (did an svn update this morning).
A few more will follow this afternoon (have an appointment).

Attached are my remaining comments on the assertion spreadsheet's
lifecycle, PM, and TX tabs regarding state transitions.

Feel free to pick or discard.

Martin

----------------------------------------------------------------------

A5.6.2-3        A persistent-nontransactional-dirty instance transitions to 
hollow if it is the pa­rameter of evict or evictAll. This allows the 
application to remove instances from the set of instances whose state is to be 
committed to the datastore.                     yes     
org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects       

Should be marked as DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects".

(BTW, the class CheckStatesOfReturnedObjects has been renamed to
StateTransitionsReturnedObjects, but it wouldn't apply to this case,
which is tested by StateTransitions.java)

----------------------------------------------------------------------

A5.6.2-5        The persistent-nontransac­tional-dirty instances will 
transition according to the RetainValues flag. With the RetainValues flag set 
to true, persistent-nontransactional-dirty instances will transi­tion to 
persistent-nontransactional. With the RetainValues flag set to false, 
persis­tent-nontransactional-dirty instances will transition to hollow.         
             yes     org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects  
     

The assertion text doesn't state the operation causing a transition,
but I assume it's commit.

Should be marked as DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects".

(See A5.6.2-3 for comment on CheckStatesOfReturnedObjects)

----------------------------------------------------------------------

A5.6.2-7        The persistent-nontransactional-dirty instances will transition 
ac­cording to the RestoreValues flag. With the RestoreValues flag set to true, 
persis­tent-nontransactional-dirty instances will make no state transition, but 
the fields will be restored to their values as of the beginning of the 
transaction, and any changes made with­in the transaction will be discarded. 
With the RestoreValues flag set to false, persis­tent-nontransactional-dirty 
instances will transition to hollow.                    yes     
org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects       

The assertion text doesn't state the operation causing a transition,
but I assume it's rollback.

Should be marked as a partial DUPLICATE A5.9-1..A5.9-190, so I'd remove
(redundant) entries "yes" and
"org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects".

The contained clause not covered by A5.9-1..A5.9-190 (StateTransition.java)
is: "the fields will be restored to their values as of the beginning of the
transaction"; but the rest is a duplicate.

(See A5.6.2-3 for comment on CheckStatesOfReturnedObjects)

----------------------------------------------------------------------

A5.6.2-9        The persistent-nontransactional-dirty instances will transition 
according to the RetainVal­ues flag. With the RetainValues flag set to true, 
persistent-nontransactional-dirty in­stances will transition to 
persistent-nontransactional. With the RetainValues flag set to false, 
persistent-nontransactional-dirty instances will transition to hollow.          
             yes     org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects  
     

Isn't this a duplicate of A5.6.2-5 ? (Same comments apply here)

----------------------------------------------------------------------

A5.6.2-11       The persistent-nontransactional-dirty instances will transition 
according to the RestoreValues flag                     yes     
org.apache.jdo.tck.lifecycle.CheckStatesOfReturnedObjects       

Isn't this a duplicate of A5.6.2-7 ? (Same comments apply here)

----------------------------------------------------------------------

A5.6.2-12       With the RestoreValues flag set to true, 
persistent-nontransactional-dirty instances will make no state transition,      
                               

A5.6.2-13       but the fields will be restored to their values as of the 
beginning of the transaction, and any changes made within the transaction will 
be discarded.                                  

A5.6.2-14       With the Re­storeValues flag set to false, 
persistent-nontransactional-dirty instances will transi­tion to hollow.         
                             
The 3 assertions are incomplete: Doesn't state an operation, but I assume
it's rollback.

Isn't this a duplicate of A5.6.2-7 ? (Same comments apply here)

Particulary, A5.6.2-12 is a duplicate of A5.9-1..A5.9-190
(and tested by StateTransition.java).

Want to merge these 3 assertions into one spreadsheet row? (as with others)

----------------------------------------------------------------------

A5.7-1  Transient-clean (Optional) state: A5.7-1 [ A transient instance 
transitions to transient-clean if it is the parameter of makeTransactional.]    
Optional                yes     lifecycle/StateTransitions.java 

Should be marked as DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.7.1-1        Transient-clean (Optional) state: A5.7.1-1 [ A transient-clean 
instance transitions to transient-dirty if any managed field is changed in a 
transaction. During the transition, values of managed fields are saved by the 
PersistenceManager for use during rollback. This behavior is not dependent on 
the setting of the RestoreValues flag]  Optional                yes     
lifecycle/StateTransitions.java 

The first sentence is a DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.7.1-2        Transient-clean (Optional) state: A5.7.1-2 [ A transient-clean 
instance transitions to transient if it is the parameter of 
makeNontransactional.]       Optional                yes     
lifecycle/StateTransitions.java 

Should be marked as DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.7.2-1        Transient-dirty (Optional) state: A5.7.2-1 [ A transient-dirty 
instance transitions to transient-clean at commit.]      Optional               
 yes     lifecycle/StateTransitions.java 

Should be marked as DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.7.2-3        Transient-dirty (Optional) state: A5.7.2-3 [ A transient-dirty 
instance transitions to transient-clean at rollback.]    Optional               
 yes     lifecycle/StateTransitions.java 

Should be marked as DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.7.2-5        Transient-dirty (Optional) state: A5.7.2-5 [A transient-dirty 
instance transitions to persistent-new at makePersistent. The values of managed 
fields saved at the time the transition was made from transient-clean to 
transient-dirty are used as the before image for the purposes of rollback.]     
 Optional                yes     lifecycle/StateTransitions.java 

The first sentence is a DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.8-1, A5.8-2  The Optimistic flag set to true changes the state transitions 
of persistent instances:• A5.8-1 [ If a persistent field other than one of the 
primary key fields is read, a hollow instance transitions to 
persistent-nontransactional instead of persistent-clean.] A5.8-2 [ Subsequent 
reads of these fields do not cause a transition from 
persistent-nontransactional.]      Optional                yes     
lifecycle/StateTransitions.java 

Both assertions DUPLICATE A5.9-1..A5.9-190, so I'd remove (redundant)
entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.8-3  The Optimistic flag set to true changes the state transitions of 
persistent instances: A5.8-3 [ A persistent-nontransactional instance 
transitions to persistent-deleted if it is a parameter of deletePersistent.] 
The state of the managed fields of the instance in memory is saved for use 
during rollback, and for verification during commit. A5.8-4 [ The values in 
fields of the instance in memory are unchanged.]     Optional                
yes     lifecycle/StateTransitions.java 

Only the first sentence of A5.8-3 is a DUPLICATE A5.9-1..A5.9-190, so I'd
remove (redundant) entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.8-5  The Optimistic flag set to true changes the state transitions of 
persistent instances: A5.8-5 [ A persistent-nontransactional instance 
transitions to persistent-clean if it is a parameter of a makeTransactional 
method executed when an optimistic transaction is in progress.] A5.8-6 [ The 
values in managed fields of the instance in memory are unchanged.]      
Optional                yes     lifecycle/StateTransitions.java 

The first assertion A5.8-5 is a DUPLICATE A5.9-1..A5.9-190, so I'd
remove (redundant) entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.8-7  The Optimistic flag set to true changes the state transitions of 
persistent instances A5.8-7 [ A persistent-nontransactional instance 
transitions to persistent-dirty if a managed field is modified when an 
optimistic transaction is in progress.] If RestoreValues is true, a before 
image is saved before the state transition. This is used for restoring field 
values during rollback. Depending on the implementation the before image of the 
instance in memory might be saved for verification during commit. A5.8-8 [ The 
values in fields of the instance in memory are unchanged before the update is 
applied.]     Optional                yes     lifecycle/StateTransitions.java 

Only the first sentence of A5.8-7 is a DUPLICATE A5.9-1..A5.9-190, so I'd
remove (redundant) entries "yes" and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A5.9-1 through A5.9-190 State transition table                  yes     
lifecycle/StateTransitions.java 

That's the big one :)

----------------------------------------------------------------------

The 'PM tab in the spreadsheet has language referring to state transitions,
therefore, a few comments.

----------------------------------------------------------------------

A12.5.1-2       A12.5.1-2 (PART 1) [If evictAll with no parameters is called, 
then all persistent-clean instances are evicted (they transition to hollow).] 
A12.5.1-2 (PART 2), A12.5.1-3 (PART 2), A12.5.1-4 (PART 2) [For each 
persistent-clean and persistent-nontransactional instance that the JDO 
PersistenceManager evicts, it: calls the jdoPreClear method on each instance, 
if the class of the instance implements InstanceCallbacks clears persistent 
fields on each instance (sets the value of the field to its Java default 
value); changes the state of instances to hollow or persistent-nontransactional 
(cannot distinguish between these two states) this is not directly testable..]  
                     yes     
api\persistencemanager\EvictAllWithNoParameters.java    2.0: Must add test of 
void refreshAll (JDOException ex);

In A12.5.1-2 (PART 2), A12.5.1-3 (PART 2), A12.5.1-4 (PART 2), the clause 
  "changes the state of instances to hollow or persistent-nontransactional
  (cannot distinguish between these two states) this is not directly
  testable..]"
is covered and tested by A5.9-1..A5.9-190.

----------------------------------------------------------------------

A12.6.1-3       The JDO PersistenceManager: • A12.6.1-2 [loads persistent 
values from the datastore into the instance;] • A12.6.1-3 [for hollow 
instances, changes the state to persistent-clean in a datastore transaction;] 
or A12.6.1-4 [persistent-nontransactional in an optimistic transaction,] and 
A12.6.1-5 [if the class of the instance implements InstanceCallbacks calls 
jdoPostLoad.]                     yes     lifecycle/StateTransitions.java 

A12.6.1-4       The JDO PersistenceManager: • A12.6.1-2 [loads persistent 
values from the datastore into the instance;] • A12.6.1-3 [for hollow 
instances, changes the state to persistent-clean in a datastore transaction;] 
or A12.6.1-4 [persistent-nontransactional in an optimistic transaction,] and 
A12.6.1-5 [if the class of the instance implements InstanceCallbacks calls 
jdoPostLoad.]                     yes     lifecycle/StateTransitions.java 

Only assertions A12.6.1-3 and A12.6.1-4 are a DUPLICATE A5.9-1..A5.9-190
and tested by StateTransitions.java.  I'd remove (redundant) entries "yes"
and "lifecycle/StateTransitions.java".

----------------------------------------------------------------------

A12.5.7-14      void makeTransient (Object pc); void makeTransientAll (Object[] 
pcs); void makeTransientAll (Collection pcs); A12.5.7-14 [The instance 
transitions to transient, and it loses its JDO identity.]                       
 yes     api\persistencemanager\MakeTransientCausesLossOfIdentity.java   

The first sentence of A12.5.7-14 is a DUPLICATE A5.9-1..A5.9-190,
and tested by StateTransitions.java.

----------------------------------------------------------------------

A12.5.7-20      void makeTransactional (Object pc); void
makeTransactionalAll (Object[] pcs); void makeTransactionalAll (Collection
pcs); A12.5.7-20 [These methods make transient instances transactional and
cause a state transition to transient-clean. After the method completes,
the instance observes transaction boundaries.]                  yes
api\persistencemanager\MakeTransactional.java   

The clause "cause a state transition to transient-clean"
is covered and tested by A5.9-1..A5.9-190.

----------------------------------------------------------------------

A12.6.8-3       With this flag set to true, during beforeCompletion all cached 
instances are prepared for detachment according to the fetch plan in effect at 
commit. Loading fields and unloading fields required by the fetch plan is done 
after calling the user’s before­Completion callback. During afterCompletion, 
before calling the user’s afterCom­pletion callback, all detachable persistent 
instances in the cache transition to detached; non-detachable persistent 
instances transition to transient;                    yes     
org.apache.jdo.tck.api.persistencemanager.detach.DetachAllOnCommit      

The clause
  "all detachable persistent instances in the cache transition to
  detached;"
is a bit inaccurate, they transition to detached-clean.

The spec's state transition table does not show any distinction between
detachable and non-detachable objects, it only shows detached-clean as
general target state.  Hence, assertion A12.6.8-3 is not covered by
A5.9-1..A5.9-190 and not tested by StateTransitions.java.

But, perhaps, the spec's state transition table should show both target
states, transient and detached-clean, for op "commit transaction with
DetachAllOnCommit true" ?

----------------------------------------------------------------------

A12.5.7-26      void makeNontransactional (Object pc); void 
makeNontransactionalAll (Object[] pcs); void makeNontransactionalAll 
(Collection pcs); A12.5.7-26 [These methods make transient-clean instances 
nontransactional and cause a state transition to transient. After the method 
completes, the instance does not observe transaction boundaries.]               
       yes     
api\persistencemanager\MakeNontransactionalTransientCleanInstance.java  

The clause
  "make transient-clean instances nontransactional and cause a state
  transition to transient"
is covered and tested by A5.9-1..A5.9-190.

----------------------------------------------------------------------

A12.5.7-27      void makeNontransactional (Object pc); void 
makeNontransactionalAll (Object[] pcs); void makeNontransactionalAll 
(Collection pcs); A12.5.7-27 [These methods make persistent-clean instances 
nontransactional and cause a state transition to persistent-nontransactional.]  
                   yes     
api\persistencemanager\MakeNontransactionalPersistentCleanInstance.java 

The clause
  "make transient-clean instances nontransactional and cause a state
  transition to transient"
is covered and tested by A5.9-1..A5.9-190.

----------------------------------------------------------------------
The 'TX' tab in the spreadsheet has language referring to state transitions,
therefore, a few comments.

----------------------------------------------------------------------

A13.4.4-1       The commit method performs the following operations  calls the 
beforeCompletion method of the Synchronization instance registered with the 
Transaction;  flushes dirty persistent instances;  notifies the underlying 
datastore to commit the transaction;  transitions persistent instances 
according to the life cycle specification; calls the afterCompletion method of 
the Synchronization instance registered with the Transaction with the results 
of the datastore commit operation.                    yes             
transactions/Commit.java:


A13.4.4-2        The rollback method performs the following operations: rolls 
back changes made in this transaction from the datastore;  transitions 
persistent instances according to the life cycle specification;   calls the 
afterCompletion method of the Synchronization instance registered with the 
Transaction                 yes             transactions/Rollback.java:


Could add a redundant comment, if you like to, that the clause
  "transitions persistent instances according to the life cycle
   specification"
is covered and tested by A5.9-1..A5.9-190.
 
----------------------------------------------------------------------

Reply via email to