I am now working wallet system ,multiple user balance update concurrently . But now the problem is when a user balance update time another transaction happened balance can not update properly. If i use optimistic concurrency for wallet balance column in database in entity framework core . The problem is solved or not
I assume you are asking a question for whether the optimistic lock column implementation solves the simultaneous balance update problem. The answer is NO, it does not solve the simultaneous balance update problem by itself. Simultaneous updates won't happen with just optimistic lock column implementation.
Optimistic lock implementation only tells you that there were simultaneous attempts to change the balance, and it stops the update that happens later than the first one (only the first of the simultaneous changes succeeds).
In order for the balance to update, you need to write code that handles the concurrency conflicts, as it's described here. The basic idea is to handle the conflict error and decide what to do. Some of the options are to ask the user what to do, or to automatically decide what to do by your code while handling the conflict error.