FIXED - Error deleting - unexpected nr of record affected

Hello,

I get the error:

Update/insert failed, unexpected nr of records affected: expected 1, actual 0
Wrapped com.servoy.j2db.util.ServoyException: Update/insert failed, unexpected nr of records affected: expected 1, actual 0

if I do this:

var _fs = order_to_order_pos__id_order;
application.output(_fs.getSize());
var _rec = _fs.getSelectedIndex();
application.output(_rec);
if(_fs.deleteRecord(_rec)) {
	....
}

The output returns the correct values but also the error occurs.
Why do I get this error?

Serrvoy 6.1.5
Win 7
Java 1.7.0_25

Regards,

The error occurred because my solution is ready for different clients and I make a databaseManager.addTableFilterParam() at onSolutionOpen.
For that I set a flag for each client on every record. I found now a bug in a function for creating a new record without the flag and that’s it.

Regards,

This error indicates that the actual delete did not happen.
We check that the database actually reports that the delete had the expected effect.
Without this check, the record would be deleted from the foundset but not actually from the database.

The same check is done when a record is updated in the db.
If for some reason the db did not report that a row in the db was updated when we run an update statement the record and the db are out-of-sync.

This can typically happen when data is changed outside Servoy, icw a filter.

Rob