# Data Disappearing in Concurrent Clients

**URL:** https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586
**Category:** Classic Servoy
**Created:** [August 4, 2010, 6:30pm UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586 "2010-08-04T18:30:50Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Infop](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@Infop](https://forum.servoy.com/u/Infop)
#### Post date: [August 4, 2010, 6:30pm UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/1 "2010-08-04T18:30:50Z")

</div>

Hi all,

We have faced one issue of data disappearing in concurrent clients. I am explaining the scenario below.

One User log in to the Application in Smart Client and start putting some texts in one field and without clicking outside. At the same time another user log in to the application with same Smart Client and do some changes and do a commit. When the 2nd. user do a commit, the entered input in that field for the first user is disappeared(The fist user has not clicked outside yet).

Anyone one have any idea to fix the same?

Thanks

---

<div class="post-metadata">

### Author: ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)
#### Post date: [August 4, 2010, 6:40pm UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/2 "2010-08-04T18:40:58Z")

</div>

Hi, can you explain a bit more?

is the second user, changing data in the same record?  
or changing data in the same field?  
by commit you mean that you use transactions?

---

<div class="post-metadata">

### Author: ![Infop](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@Infop](https://forum.servoy.com/u/Infop)
#### Post date: [August 4, 2010, 6:48pm UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/3 "2010-08-04T18:48:38Z")

</div>

Hi Harjo,

Thanks for your quick reply.

> Harjo:  
> is the second user, changing data in the same record?

No. But, the second user uses the same relation, on which the Form based on, which the first user is entering texts at fields.

> Harjo:  
> or changing data in the same field?

No

> Harjo:  
> by commit you mean that you use transactions?

No. Just uses the databaseManager.saveRecord() method.

Thanks

---

<div class="post-metadata">

### Author: ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)
#### Post date: [August 4, 2010, 6:51pm UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/4 "2010-08-04T18:51:08Z")

</div>

never seen this

than I suggest you make a (small) sample solution, that demonstrates this and file a case at: [www.servoy.com/s](http://www.servoy.com/s)

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [August 5, 2010, 8:54am UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/5 "2010-08-05T08:54:04Z")

</div>

yes it shouldnt do this, it should only overwrite if both are on the same field of the same record and person number 1 is faster and saves it.  
Then person nr 2 will see those changes,so his value is gone. But for other fields this shouldnt matter.

---

<div class="post-metadata">

### Author: ![ruferllo](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@ruferllo](https://forum.servoy.com/u/ruferllo)
#### Post date: [September 26, 2011, 8:45am UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/6 "2011-09-26T08:45:00Z")

</div>

Hi all,

we have the same problem and we are trying to control when 2 clients are editing the same record (using adquireLock Servoy’s method for the first client that wants to edit a record and sending a message to the second client notice him about the lock).

Any news about it?

Thanks

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [September 26, 2011, 9:41am UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/7 "2011-09-26T09:41:00Z")

</div>

so what is exactly then your problem if you are using locks?  
Then you shouldn’t have concurrent updates.

---

<div class="post-metadata">

### Author: ![ruferllo](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@ruferllo](https://forum.servoy.com/u/ruferllo)
#### Post date: [September 26, 2011, 10:36am UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/8 "2011-09-26T10:36:44Z")

</div>

Our main problem is concurrent clients, so for this we are trying to lock the record that is in use by 2 clients using onRecordEditStart and onRecordEditStop events.  
The second problem is that our solution for the main problem is not working properly, our problems are:

- release locks at radiobuttons,checks,… (not textfield or textarea)
- when we edit a field (from a db table) and we want to edit other field (based in other db table) the onRecordEditStart event doesn’t trigger, it only works the first time you edit a record after a saveData() so we can’t identify when we are editing another record to release the actual lock and generate other lock for the record.

Any advice?  
Thanks

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [September 29, 2011, 9:30am UTC](https://forum.servoy.com/t/data-disappearing-in-concurrent-clients/12586/9 "2011-09-29T09:30:07Z")

</div>

I guess it would be better if you have an explicit edit mode for this then  
So that you can go into edito that sets all the locks and goes out of edit that releases all the locks
