Data change notification in multi user environment

Posted on 1998-08-23
Medium Priority
Last Modified: 2008-02-20
I am using Codebase as the database engine for a multi user (and single user) Windows application.  In a multi user system,  if two users have a data file open and a change is made by one user, how can I get notify the other running application on the other user's PC that a change has been made to the datafile.  I need this functionality to so that the screen/view can be updated to reflect the changes made by the other user.

ie: Windows explorer automatically updates window contents if an item (directory, shortcut etc..) is added to a directory via Network Neighbourhood  on a remote PC, the Windows Explorer screen will be automatically updated to
show this new item.  This is the functionality I am after.

I have (very) limited multi user programming experience so any help would be greatly appreciated.

Question by:Woodster
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

gmoriak earned 400 total points
ID: 1025558
You're going to have to "fake it".  You could have a timer execute a simple check to see if data has changed every 30 seconds etc.  If data has changed, you would then refresh all of your data.  You need to keep the check simple and fast and execute it as infrequently as possible so as not to degrade perfarmance.

Any more sophistacated solution would involve creating an n-tier application solution.  The above solution is generally a good enough simulation.  Explorer isn't immediate either, there is a lag between files being updated and view being refreshed.


Author Comment

ID: 1025559
Is there a method of doing this within a single threaded application.  We use an application framework (not MFC) that doesn't seem to like being used in a a multi threaded environment so I am not sure if this solution is applicable.  

Even if using the method you described, how can I tell if a particular record has changed (relational database) without storing the original copy of the record in memory which could result in a large overhead if there are many records being displayed?

What is an n-tier solution?  Would a client/server type set up resolve this problem?  I have not used a Client/Server set up before so am unsure as to the implications of such a system.

Expert Comment

ID: 1025560
Client server generally ignores the problem without too many consequences.  Users don't typically update the same thing and when they do, you can simply display a message saying "Data changed etc."

Author Comment

ID: 1025561
Sorry for the (exceptionally) late response.  The problem is, if I can't determine that the data has been changed, how can I display a message to inform the user?  Do you have any answers for the other questions in my previous comment?

Expert Comment

ID: 1025562
Have a lastMod_date column in your table.  Retrieve it when bringing back data and check to make sure it is the same when updating (put it in your where clause)  If it hasn't changed, you know that nobody has changed your data.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question