Apologies if this in the wrong section but I couldn't see a anything for non SQL databases. I'm pretty new to Servoy but am trying to create a web-client to work along side a Foxpro application.
Much of what I'm doing will be reporting but I want users to be able to edit and add records to certain tables. With this in mind, I've tried using the following to lock a record, using the onRecordEditStart event.
- Code: Select all
var success = databaseManager.acquireLock(foundset,0,'GrpRec');
if(!success)
{
plugins.dialogs.showWarningDialog('Alert','Failed to get a lock','OK');
}
I can see the record lock in the Server Administration but my Foxpro app is not and so using the separate interfaces it is possible to edit the same record.
Equally if I lock a record through editing in the Foxpro app, the above snippet still thinks it has successfully locked the record and both users can edit.
That said, if I have a record locked from the Foxpro app, when the onRecordEditStop event triggers the databaseManager.saveData() an error is produced in the console.
Cannot save form data
> com.servoy.j2db.dataprocessing.DataException: Record of 2 in Group has been locked by another process
So I guess I'm going about my record locking the wrong way, can someone advise me please...
Kind regards,
Tony