01-25-2009 02:17 PM
I am developing a library that stores data in the persistent store. Because it is a library, it is possible for two apps running simultaneously to both attempt to access the p-store at the same instant. I can't find a global lock object on the device, is there some way to get a lock to the store, or should I switch to files or some other, lockable, resource?
01-25-2009 03:06 PM
But does that work if I have two instances of the class in totally seperate applications running at the same time? My understanding was that synchronized is per-object. So two different objects could both try and access the store at the same time.
01-25-2009 04:08 PM
PersistentStore does have a public static Object getSynchObject()
method which I would have thought would return an object global to the
JVM but that may not be the case.
Presumably the gui ends up having to be synchronized across apps too,
I don't think this is impossible. I guess you could call thjis method in the debugger from the
two competing apps and see if it returns the same addresss.