record_locking not work fine

Hello, i have a problem with the Record locking option. I check the option in the program qcinst_unidades

And after, i try to edit the same at the same time of other user, but in the code of the function inside of dc_edit, in the svy_nab_base in line #509

if (globals.nav.program[_program].record_locking) {

		if (controller.view != 0) //list or table view, so lock more records
		{
			_success = databaseManager.acquireLock(foundset, -1, _program)
			if (!_success) {
				globals.DIALOGS.showWarningDialog(i18n.getI18NMessage('svy.fr.lbl.warning'), i18n.getI18NMessage('svy.fr.dlg.record_lock'), i18n.getI18NMessage('svy.fr.lbl.ok'));
				return;
			}

		} else {
			_success = databaseManager.acquireLock(foundset, 0)
			if (!_success) {
				globals.DIALOGS.showWarningDialog(i18n.getI18NMessage('svy.fr.lbl.warning'), i18n.getI18NMessage('svy.fr.dlg.record_lock'), i18n.getI18NMessage('svy.fr.lbl.ok'));
				return;
			}

		}
	}

But when arrive to this point:

_success = databaseManager.acquireLock(foundset, 0)

Allways return true, and never return false, instead of other user different of me, editing the record.

pentamsi,

databaseManager.acquireLock(foundset, 0) locks the currently selected record in the foundset.
Are you sure the selection in both clients is the same, do they lock the same record?

Rob

Yes, I’m 100% sure. Both clients are connected to the same database, but the solution not is allowed in a servoy server, everyone run in his own machine and connect to the same database, this maybe a problem? but i understand if the database is the same, there not have to be a problem, no?

So you have multiple ApplicationServers running against the same database?

Record locking is managed within the appserver, it works between clients connected to the same appserver.
Servoy does not expect to share between appservers, so also other things, like databroadcast also does not work over multiple appservers.

We have some support to share state and db-level locking between appservers, but you would need to configure this.

Why do you need separate appservers?

Rob

No, for the final client all users connect to the same appserv, but when we are developing, every developer have her own servoy in local, and all connect to the same database. But now i’m trying to make a connection with the server, but show me this error.

Any idea?

Servoy developer starts it’s own application server in the background, so you can’t test record locking between developers.

What you can do to test it, is start a smart client and a webclient, then you should not be able to edit the same record.