Solved Sync/delivery problems multiple users editing the same Access form. (1 Viewer)

Danylo

New member
Local time
Today, 13:16
Joined
Jun 22, 2023
Messages
17
My problem is connected to multi-users accessing to one form and editing data on it simultaneously.

The root of the problem is that, when several users are connecting to the DB, the last one who connects obtain a "priority". As a result, whenever one of the users is editing a field in form and save the changes, after what happens synchronization of data stored on the server for each user except the one with "priority". But if prioritized user ( the last connected ) is making a change, everybody will synchronize with his change.

Currently there are 5 active DB users, the database is split and shared, so the tables are stored on virtual driver and everyone have access to it, each user has a local copy of an Access database file that contains links to the tables, along with queries, forms, reports, and other database objects. There are more than 70 tables, and part of them holds over a thousand of records. Commonly, work related to DB focuses on data entry.

As a first step, lock system were implemented, we used lock on "Edited record", which seems to work properly, so no matter whether it's prioritized user or not, as soon as that user start to change data in a form he is locking it, but after that user made the change and saved data if he don't have the "priority" his change won't be applied to prioritized user.

In order to clear up the problem, i will simulate a problem situation: User1, User2, User3 accessing DB in the appropriate sequence. User3 gaining "priority". Every user accessing form of the same PO, and trying to change Supplier field. User2 was the first one to make the change , so he is locking the record. After the change was made and data was saved. Synchronization happens to User1 and he receives changed data about supplier, but User3(prioritized) keeps the old data. Then we repeat the process , but now User3 are making changes. At the end, after synchronization, both User1 and User2 receives newest Supplier data.

As an addition I'm sharing the link which contain the video of the problem:
.Sadly the quality is poor so as an explanation to what's going on: firstly, the record status is changed by 'Prioritized' User2 from "Editing" (blue) to "Validation" (yellow) and saved after what User1 synchronizing the data and receives the change, after that User1 is changing and saving the data but nothing happens on synchronization for User2, so at the end 2 users stay with 2 different record versions.

Also, sometimes when ‘uprioritized’ user ( User1) are making the changes and User2 keeps an old unchanged data, after User2 decide to make synchronization either by button or just exit from the form or the automatic synchronization happens, old unchanged data becomes saved and each user receives it.

So as a conclusion to all of that , MS Access Optimistic Concurrency Control (Optimistic locking), to be more precise Last in Wins approach is not working properly.


After additional research, I found out that on each user entrance .laccdb file responsible for "Microsoft Access Record-Locking Information" each user gains Admin status, may it be the cause of ‘priority’ problem?

Is there a away to solve that issue without implementing custom locking or Optimistic Concurrency Control approach, such as timestamps use?


For additional information and suggested solutions, I've posted same issue on Microsoft forum. I didn't mean to harm anyone's feeling, by doing that, I found each reply very useful, and the only reason for doing that is to gain as much information as possible, since I'm really new to Access and DB overall, and there is so much information to be covered.
P.S. Sadly I can't insert a link, since I've been receiving "inadmissible context" error, thankfully XPS35 mentioned that link.
Solution:

The root of the problem is a wrong sharing approach (using QNAP NAS to hold BE), during the test with LAN sharing, the issue disappeared.
 
Last edited:

XPS35

Active member
Local time
Today, 13:16
Joined
Jul 19, 2022
Messages
159

cheekybuddha

AWF VIP
Local time
Today, 12:16
Joined
Jul 21, 2014
Messages
2,280
Is your database split into front-end and backend?

And does each user heave their own copy of the front-end?


Currently there are 5 active DB users, the database is split and shared, so the tables are stored on virtual driver and everyone have access to it, each user has a local copy of an Access database file
Sorry, managed to miss all that!
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
STOP ---- You CANNOT share an Access database using Cloud technology. STOP or risk corruption and data loss. Only Windows can support sharing an Access database.

If your users are not all on the same LAN, your options to share are limited to Citrix or Remote Desktop. If your BE does not have tables that contain more than about 5000 rows, you can convert the BE to SharePoint. Some people have reported success using Azure as the BE but others complain that this is much like watching paint dry.

But there is total consensus on the use of cloud technology to share an Access application - DO NOT DO THIS. It is a huge risk.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:16
Joined
Feb 28, 2001
Messages
27,186
Pat beat me to it, so I will merely concur with her response. Access + Cloud is a disaster waiting to happen. Those places that CLAIM that they allow Access + Cloud to work aren't telling you the whole story.

Here is the short technical answer. Cloud-based storage doesn't use the protocol call Server Message Block (any version thereof), and SMB is the basis for ALL repeat ALL Windows file sharing and printer sharing technology. If the Cloud server won't allow SMB connections, you WILL repeat WILL corrupt your database quickly. Cloud servers usually allow FTP or HTTP variants (which are whole-file sharing methods), but they do not use SMB (which is a partial-file sharing method).
 

561414

Active member
Local time
Today, 06:16
Joined
May 28, 2021
Messages
280
Access + Cloud is a disaster waiting to happen
You CANNOT share an Access database using Cloud technology... DO NOT DO THIS. It is a huge risk
Mind elaborating why you believe this is a cloud issue?

OP:
Here's my 1.5 cents, when something in Access does not work, which is not uncommon, implement it yourself. Lock your records in a custom way, make a table where you can store which records should be locked and also release the locks using a custom method. That way you have full control. Just make sure to implement tests regularly, so you can verify things are functioning correctly and research concurrent programming if you haven't already.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:16
Joined
Feb 28, 2001
Messages
27,186
Mind elaborating why you believe this is a cloud issue?

OP:
Here's my 1.5 cents, when something in Access does not work, which is not uncommon, implement it yourself. Lock your records in a custom way, make a table where you can store which records should be locked and also release the locks using a custom method. That way you have full control. Just make sure to implement tests regularly, so you can verify things are functioning correctly and research concurrent programming if you haven't already.

1. It is not uncommon to call a cloud drive a "virtual" drive, which is how the OP described it.

2. Give yourself a full 2 cents on that idea, within limits... the limits being that you have to have a good reason to believe you are running into a true data sync problem that requires unusual locking. NORMALLY the Windows/Access locking scheme is adequate, particularly if you set the record-locking attributes correctly for your queries and forms. But you DID say "when something ... doesn't work" so a custom method of locking IS a possible response in that case.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:16
Joined
Feb 28, 2001
Messages
27,186
@Danylo - Not only did you post the same question on another forum, but you got a lot of answers, including one that described the pitfalls of allowing multiple users to edit the same record at the same time from two different client computers. This should NEVER EVER happen in ANY data management system. The old phrase "too many cooks spoil the broth" comes to mind, as does "too many chiefs, not enough indians." The technical name for the effect is "destructive interference" which is what happens when "the left hand doesn't know what the right hand is doing."

Allowing multiple users the ability to modify the same record at the same time is a disaster waiting to happen because the "priority" that YOU describe is basically a way of saying "who gets the lock first?" - and it is a decision that occurs at network speeds because your 5 users are all remote with respect to the file server holding your file. The file server that "owns" the back-end file is also the server that owns the file locks because that is the way that Windows works. So all decisions are made in the back-end server.

Everything will be measured in milliseconds because that is how long it takes a system to resolve network lock disputes. From your description of the work flow, it might as well be random as to who is on first. To expect order out of this chaos is unrealistic without a formal "pre-lock" and "post-lock" pair of actions to guarantee exclusive access to a particular record. Which opens up ANOTHER can of worms as now you have THREE transactions that have to occur - the lock, the update, and the unlock. This is just multiplying trouble because if you have gone this far, you now have to worry not only about the original change but also the lock and unlock transactions having issues. This design cascades quickly.

Oddly enough, in this thread and in the other thread, you never clarified exactly what you meant by a virtual drive or virtual driver. So let's ask right now... are you talking about a cloud-based server for your back-end files?

And finally, you are new to us, so you might not know this - but we consider it impolite to post a question which has already been asked and answered on another forum. We call this cross-posting. It is a way to waste the time of people who volunteer to help others out of the kindness of their hearts. The proper way to handle this would be to state your problem but ALSO state that you asked in another forum but so far have not gotten any usable answers. Then post a link to the thread in the other forum so we can see what has been suggested and maybe offer something else than what you've hear before.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
Mind elaborating why you believe this is a cloud issue?
Easy, Because Jet and ACE have no problem sharing an Access BE on a LAN and controlling whose update prevails. If Jet and ACE (Access has actually nothing to do with this) couldn't control serializing updates, they would be pretty poor database engines and would have died years ago. Also, the op kept talking about synchronizing and that is simply not something that happens when sharing a BE on the LAN. There is only ONE data source and that is the shared BE on the LAN. There is no reason to synchronize anything.

If your processes are updating multiple tables and all updates must be completed or all must be rolled back, you can put Access into what is commonly called a "deadly embrace" if your processes don't always lock the tables in the same order. Short of that, Access, left to its own devices - optimistic locking - does not attempt lock a record until the user goes to save it. The conflict occurs if two users read the same record and both try to update it. The first user to submit the update, achieves the lock regardless of who read the record first and his data gets saved. Other users, will get a confusing error message with three options when/if they try to save. There are other locking options. The one that control freaks love is "pessimistic" locking. That method locks the record when the user reads it. Yep, that sure solves the problem as userA reads a record and heads out for a two hour lunch locking up the record and keeping everyone else out.

Here's my 1.5 cents, when something in Access does not work, which is not uncommon, implement it yourself.

Access is a RAD tool. It works the way it works. And it works that way for a specific reason - it is a RAD tool. Its design is engineered to help you by doing things for you. You give up the flexibility of doing it yourself for the sake of doing a lot less work. Most people feel it is a fair trade. Access is not a general purpose development tool. It works extremely well for a specific type of application and there is no tool that is better or more cost effective available today for this specific type of application. If you don't like the way it works, find a different tool rather than panning the tool you have. Perhaps Access doesn't work for you because you are using it for some inappropriate task like trying to serve up a web page or you just don't understand how it is intended to work. It's an attitude thing. When I have trouble trying to bend Access to my will, I don't automatically think that Access is a stupid, inferior tool and that I can do it better. I sit back and think, OK, how would Access do this? Sometimes Access really can't do what I want but more likely, I've just been looking at the problem from the wrong angle.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
@The_Doc_Man as we all know, Jet/ACE use the lock file to synchronize updates. The lock file keeps track of who is dong what to which rows. That is why in order for Jet/ACE to actually share a database, the lockfile has to be created in the folder that holds the BE database and must be sharible and updateable by all users. The issue with the cloud is that copies of the database are made for each separate user and there is no commonly shared lock file.
 

561414

Active member
Local time
Today, 06:16
Joined
May 28, 2021
Messages
280
@Pat Hartman
I will rewrite what I said from:
when something in Access does not work, which is not uncommon, implement it yourself.
To:
when something in Access does not work, or when its opinionated nature conflicts with a part of your software architecture, which are not uncommon scenarios, implement the feature yourself.

Let's not go down the path of me vs you. Thanks for your clarification on why you suspect this is a cloud issue.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
No, we don't need to go there but you would be ever so much happier using a tool that wasn't as stupid as Access. i don't understand why you stick with it;)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:16
Joined
Feb 28, 2001
Messages
27,186
@The_Doc_Man as we all know, Jet/ACE use the lock file to synchronize updates. The lock file keeps track of who is dong what to which rows. That is why in order for Jet/ACE to actually share a database, the lockfile has to be created in the folder that holds the BE database and must be sharible and updateable by all users. The issue with the cloud is that copies of the database are made for each separate user and there is no commonly shared lock file.

I know that intimately well and have posted on Windows and Access locking mechanisms. However, there have been times when it was necessary to "reserve" a record (temporarily) to do several "related-record" edits. Hey, it's a rare bird, but sometimes that is what you have to do meet the customer's requirements. But you will note that I also replied to 561414 that it would be rare to take it that far. In the world of dealing with customers, "NEVER" is an impossible word. On the other hand, "WILL COST THREE TIMES AS MUCH AS DOING IT NORMALLY" often works.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
The point Doc, is that if there is not a common place to store lock information, then you have no way to control sharing. Edgar was implying that there would be some magical way of YOU coding something that the cloud technologies simply do not support. Are you saying that you can suggest a method that makes an Access database safely shareable using a cloud drive?
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Jan 23, 2006
Messages
15,379
Danylo,

I hope that the responses in this thread and in the Microsoft Community thread have answered your request. It seems you moved to AWF today hoping to get different results.
As Peter said in post #2, it is considered proper netiquette to advise readers that you have posted in multiple forums.
I believe a review of your business process that is requiring simultaneous update to a record is in order.

Good luck with your project and belated welcome to this forum.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:16
Joined
Feb 28, 2001
Messages
27,186
The point Doc, is that if there is not a common place to store lock information, then you have no way to control sharing. Edgar was implying that there would be some magical way of YOU coding something that the cloud technologies simply do not support. Are you saying that you can suggest a method that makes an Access database safely shareable using a cloud drive?
Yes. Make it single access at a time and force users to use a telephone to coordinate it. They will quickly get frustrated and try a CITRIX or RDP method instead.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
The best solution is to use the correct tool. Sometimes you can use the wrong tool incorrectly and achieve the end goal. However, only someone with a death wish uses a power lawn mower to trim a hedge. That is the equivalent of trying to share an Access database using a cloud drive.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 19, 2002
Messages
43,275
Well, I just noticed that there was a link to the conversation on a different forum so I read it. I can't tell what you are talking about with who has "priority" and "synchronizing" Are you trying to use an Access application using cloud technologies or is everyone on the same LAN? As Albert pointed out, it is an extremely rare situation where multiple users would ever need to update the same record at the same time. What triggers these simultaneous updates? How many concurrent users do you have? No RDBMS can allow multiple concurrent updates. All updates are serialized. The first update wins.

I'm asking these questions because Jet and ACE do not have any problem determining which update wins regardless of whether you leave the default locking plan or choose a different one. The update that loses, generates an error message with three confusing choices when you use Optimistic locking and multiple updates are prevented if you choose a different locking option so there is no confusion.

If you use ANY locking method except the default which is Optimistic locking, you run the risk of a careless user locking out every other user. But if you use Optimistic locking, you need to instruct your users to alway select the discard my changes option to the update conflict question. If they can't be trusted to do this, then you need to add code to trap that error and provide the discard answer using code.

Also, if the bE is NOT Jet or ACE, you have no control over the locking plan from Access since it is not impacted by your settings in the Access FE or BE.
 

Users who are viewing this thread

Top Bottom