03-01-2010 02:10 PM
I don't think so. Pulling the battery is rather sudden, and so it's highly unlikely that some kind of notification would be sent. You could listen for low battery, but I don't think that's what you had in mind.
Take this with a grain of salt: I'm no expert.
03-01-2010 03:43 PM
Use the PersistentStore and commit regularly. This way if there is a power failure between commits, you will have consistent data up to your last commit (the usual transaction oriented model).
03-02-2010 03:20 AM
Thanks a lot DAquilina and ydaraishy,
My first approach was, what ydaraishy has commented, create a Timer object that periodically commits the application data, by using PersistenceObject and PersistenceStore
As I'm seeing that's the only way to do that, I'm going to mark it as the good solution
03-02-2010 03:25 AM
Using a timer is probably unnecessary -- you just have to take care that whenever the contents of the variable of interest changes, you run a commit straight afterward.