Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Web app - How can I handle events from a user synchronously?

$
0
0

I have a Blazor Interactive Server app. On several of my pages I have a component where the user can register for an event. There are 4 buttons (No, Undecided, Interested, Attending). When they click the button, that fires an event that reads 2 records from the DB, updates them with the signup status, and saves them.

Users are quickly clicking several buttons (no idea why). The end result is I am getting a DbUpdateConcurrencyException because it reads the records in the several event handler calls, updates them, then goes to save them and all after the first throw a DbUpdateConcurrencyException.

Is there a way to force this event handler, for each session, to be processed synchronously? The records involved are user records so there is no conflict across sessions unless a user connects via 2 browsers and clicks at the same time - in which case tough.

Update: My QA tester has verified that it was running slow for him (due to his internet connection) and so he was clicking several times thinking it didn’t register the first time.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>