Page 1 of 1

Locking in multi-user application

Posted: Fri 19 Aug 2016 19:20
by jeen
I am using .NET Framework 4.6.1, WinForms, PostgreSql 6.4beta4 and Npgsql and ADO.NET.

My current application is a multi-user-application where all users connect to the same database.

Data gets binded to the controls by using DataTable, BindingSource and BindingNavigator.

I want to avoid that two users can edit a DataRow at the same time. Because i want to implement this on a more general approch i was thinking about creating a DataTable descendant and add the property LockMode (None, Row, Table).

I found out that you can use the ColumnChanged event in combination with RowState to detect changes on the data.

I now know whether the user is inserting a new value, editing (RowState = modified) a existing one or is just looks (RowState = Unchanged) at the record.

Therefore i am looking for a solution to lock the DataRow once a user starts editing it. In the application i want to display a message once a user navigates (by using the Bindingnavigator or programmatically) to a locked record.

I saw that your solutions for Delphi offer some kind of Locking feature. I am wondering if my described screnario can be realized with your components?

Re: Locking in multi-user application

Posted: Tue 23 Aug 2016 09:50
by Pinturiccio
Unfortunately, dotConnect for PostgreSQL does not have properties or methods in PgSqlDataTable or DataLink classes which provide a ready solution for the issue.