I'm having trouble deleting a persistent record.
I use find() to get one of them, and call
theRecord.deleteRecord();
However, I can still query for the record, its still in the database.
boolean isDelete = theRecord.isDeleted();
boolean isDirty = theRecord.isDirty();
However, isDelete is true, so it did something. But since isDirty is also true, it hasn't been flushed to the database? How often is this done, or is this something I have to call myself? I've even restarted the gateway and it is still there?
Here's the relevant part of the doc:
public void deleteRecord()
Sets a flag to delete this record when the transaction is commited. The record is not removed from the transaction cache. Any future findOrCreate will thus return the deleted record but its fields may not be referenced. (isDeleted can be used to determine that the record has been deleted.)
The record is only deleted from the database when the transaction is committed or is flushed. Thus a transaction that nulls out references to a parent record and then deletes the parent record will not cause a referential integrity violation because the update order is preserved so that the updates will (normally) be performed before the deletes.
And what's weirder, is that I can still reference the fields? Using isDeleted should work for the time being, but this behavior seems odd, and I'd like to be able to completely remove these entries permanently.