You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig L Russell <Cr...@Sun.COM> on 2005/12/09 20:15:59 UTC

Assertions for 5.6.2

Javadogs,

I've slightly redone the assertions because some are related just to  
life cycle changes (tested in the life cycle test) and others are  
related to behavior. Here's the updated spec (only assertions are  
changed).

Craig

Persistent-nontransactional-dirty (Optional)
JDO instances that represent specific persistent data in the  
datastore, whose values may be currently loaded but not  
transactionally consistent, and have been modified since the last  
commit, are persistent-nontransactional-dirty. A5.6.2-1 [ There is a  
JDO Identity associated with these instances], and A5.6.2-2  
[ transactional instances can be obtained from the object ids.]
The persistent-nontransactional-dirty state allows applications to  
operate on nontransactional instances in the cache and make changes  
to the instances without having a transaction active. At some future  
point, the application can begin a transaction and incorporate the  
changes into the transactional state. Committing the transaction  
makes the changes made outside the transaction durable.
A5.6.2-3 [A persistent-nontransactional-dirty instance transitions to  
hollow if it is the parameter 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.]
A5.6.2-4 [If a datastore transaction is begun, commit will write the  
changes to the datastore with no checking as to the current state of  
the instances in the datastore. That is, the changes made outside the  
transaction together with any changes made inside the transaction  
will overwrite the current state of the datastore.] A5.6.2-5 [The  
persistent-nontransactional-dirty instances will transition according  
to the RetainValues flag. With the RetainValues flag set to true,  
persistent-nontransactional-dirty instances will transition to  
persistent-nontransactional. With the RetainValues flag set to false,  
persistent-nontransactional-dirty instances will transition to hollow. ]
A5.6.2-6 [If a datastore transaction is begun, rollback will not  
write any changes to the datastore.] A5.6.2-7 [The persistent- 
nontransactional-dirty instances will transition according to the  
RestoreValues flag. With the RestoreValues flag set to true,  
persistent-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 within the  
transaction will be discarded. With the RestoreValues flag set to  
false, persistent-nontransactional-dirty instances will transition to  
hollow.]
A5.6.2-8 [If an optimistic transaction is begun, commit will write  
the changes to the datastore after checking as to the current state  
of the instances in the datastore. The changes made outside the  
transaction together with any changes made inside the transaction  
will update the current state of the datastore if the version  
checking is successful.] A5.6.2-9 [The persistent-nontransactional- 
dirty instances will transition according to the RetainValues flag.  
With the RetainValues flag set to true, persistent-nontransactional- 
dirty instances will transition to persistent-nontransactional. With  
the RetainValues flag set to false, persistent-nontransactional-dirty  
instances will transition to hollow.]
A5.6.2-10 [If an optimistic transaction is begun, rollback will not  
write any changes to the datastore. The persistent-nontransactional- 
dirty instances will transition according to the RestoreValues  
flag. ] A5.6.2-11 [With the RestoreValues flag set to true,  
persistent-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 within the  
transaction will be discarded. With the RestoreValues flag set to  
false, persistent-nontransactional-dirty instances will transition to  
hollow.]

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!