[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

650 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