10-14-2009 05:49 PM - edited 10-14-2009 05:50 PM
I'm looking at code that I wrote which works, but I'm not quite sure how PersistentObject.commit() works. More specifically how does it know what persistent store ID to use?
Here's some sample code:
PersistentObject persistentObject = PersistentStore.getPersistentObject(PERSISTENT_ID)
Object o = persistentObject.getContents();
// code to cast o to "data"
10-14-2009 06:12 PM - edited 10-14-2009 06:20 PM
10-14-2009 07:40 PM
I don't think type is relevant, you have multiple objects of the same type stored in different IDs.
I must admit that I had always assumed that the static commit was used against objects that you had previously used with a setContents, so the persistence processing just had to search the defined PersistentObjects and find the one whose content was the Object identified. But there is no Exception defined that can be thrown if the object has not been previously used in a setContents and no documentation that I can find that says this. Just my speculation.