Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Change Notification in .NET?

Status
Not open for further replies.

avarga82

Programmer
May 19, 2003
62
US
Hi all:

I'm developing a multi-user app in VB.NET with a SQL 2K backend, and I am concerned about record concurrency. It would be great for the user to receive some sort of notification when the record he/she is working on is being edited, or has been changed. How would I approach this?

Any help would be appreciated. Thanks!
 
Because the data is disconnected there is to my knowledge no way of achieving this, apart from adding a flag to the table, and controlling the locking/unlock status yourself.


Sweep
...if it works dont f*** with it
curse.gif
 
when you update via the dataadapter the dataadapter will check to see if the data is still the same as when it was filled.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Chrissie

Having not used the data-adaptor I didnt know that. I would guess that the rowerror will be set for each datarow processed in the update.

How then could you
1) Allow updates regardless. (Optimistic buffering)
2) Disallow update conflicts (Pessimistic beffering)


Sweep
...if it works dont f*** with it
curse.gif
 
1) don't know. I always refuse to do the update and let them reenter the data after doing a new fill and showing them the new data.
2) that I think is standard. It stops updating when it sees that records have been changed since the last fill.

But I must say that this rarely happens. BTW I did some testing in the beginning to see the effects and it really works don't ask me how he does it.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Gotcha...so what you're saying is that Pessimistic Buffering is the de-facto standard. I can understand why, but Im also sure there are cases for the former. But then again you can always work around by not using the dataadaptor.



Sweep
...if it works dont f*** with it
curse.gif
 
yes looking for workarounds is what I do for a living.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
OK...moving on to a workaround...

Would this be possible?

Everytime a user opens/edits/deletes a record, somehow send a notification to the other users as a messagebox or a notify box or whatever, and just handle the notifications myself?

If that would work...what would be the best way to send a notification short of flagging the actual record, and requerying the database?

Ignoring the database side of it, how would I send a notification? For example, when outlook gets a new message, it shows a notification. How could I do something like that? Surely .NET comes equipped with something...
 
To notify any users possibly editting the record would be rather complex. You'd have to consider, who is all has the data? who might be affected by an edit of the record? what workstation are they at? never mind the work to send notification.

Might make more sense to merge the records (if the same record happens to be editted at the same time) rather than try to notify any users out there.

Dale

 
Well, here's the problem. Maybe someone can suggest a good solution:

It's an app designed to keep track of shipments, and trucks that move the shipments. A user will get a list of available shippers at any given time, and while on the phone with a client, will assign a shipper to a shipment. The problem is, if User A is on the phone with someone, and you go to assign a shipper, and User B JUST assigned the shipper, I want to alert User A, because he should be notified immediately so he can reassign the shipment to another shipper. Keep in mind User A will be on the phone, and this whole thing has to be quick.

*Sigh*

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top