A while ago, I wrote an application used by multiple users to handle trades creation. I haven't done development for some time now, and I can't remember how I managed the concurrency between the users. Thus, I'm seeking some advice in terms of design.

The original application had the following characteristics:

  • One heavy client per user.
  • A single database.
  • Access to the database for each user to insert/update/delete trades.
  • A grid in the application reflecting the trades table. That grid being updated each time someone changes a deal.
  • I am using WPF.

Here's what I'm wondering:

  1. Am I correct in thinking that I shouldn't care about the connection to the database for each application? Considering that there is a singleton in each, I would expect one connection per client with no issue.

  2. How can I go about preventing the concurrency of the accesses? I guess I should lock when modifying the data, however don't remember how to.

  3. How do I set up the grid to automatically update whenever my database is updated (by another user, for example)?

Thank you in advance for your help!

Edit
Report