473,776 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Notifying other running instances of my app of changes to list contents.

I have an application that has many windows. One window is used for
order processing. I would like this window to display the other users
who are also performing order processing (the idea is to prevent a user
from opening an order that is being worked on by another user.

I have considered using the database:

* my query can return a user id or other identifier along with the
order record so that when I populate my list view control, I can
display the user who is working on that record.

* if the user trys to open one of these records I can tell them
'someone else has this right now'.

* I want to avoid hitting the database to update this list using a
timer control and multithreading (the reason I would do that is to
periodically update each users list view with the most current users
using whatever order).

the bad part of this idea is that when the window initially loads and
populates the list, it only knows about the other users at that time.
the user would click on something that looks 'open' to them only to
find out it's not really open to them.

I'm looking for a way to make my order list more dynamic- meaning, if
user A has the order list widow open, and so does user B, I want the
window user B is using to be aware of user A's change (open a new order
for processing).

Am I on the right track? Is the list view not the right component? I
know gridview and datagrid can be sensitive to database changes, but I
cannot see how I can avoid the use of a timer in any of the above (or
will the grid component's automatically sense changes to the database
outside of themselves?).

I'm considering using some type of network communication to get these
messages across. Is this a good idea, or bad?

thanks for any thoughts- I am really stuck here. I'm concered that I
am missing something easy and obvious...

Jul 18 '06 #1
3 1268
IdleTask,

What you're asking is the difference between pessimistic and optimistic
concurrency.
A not so simple problem to answer in a newsgroup.

Pessimistic concurrency is based on the fact that in a database two users
can update often the same data at the same time.

Optimistic concurrency is based on the fact that time has learned that the
first situation occurs in most standard situations seldom, however that
errors because of that has to be prevented, so there is a checking
afterwards if something has been changed in the meantime.

Pessimistic concurrency is very difficult to do without getting the change
on deadlocks. It has as well a very hug impact on the performance of a
database (the reason that is not anymore in AdoNet while it was in Ado).

Therefore it is in my idea better to over think your plans again.

http://msdn.microsoft.com/library/de...oncurrency.asp

I hope this gives some ideas

Cor
<id******@msn.c omschreef in bericht
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
>I have an application that has many windows. One window is used for
order processing. I would like this window to display the other users
who are also performing order processing (the idea is to prevent a user
from opening an order that is being worked on by another user.

I have considered using the database:

* my query can return a user id or other identifier along with the
order record so that when I populate my list view control, I can
display the user who is working on that record.

* if the user trys to open one of these records I can tell them
'someone else has this right now'.

* I want to avoid hitting the database to update this list using a
timer control and multithreading (the reason I would do that is to
periodically update each users list view with the most current users
using whatever order).

the bad part of this idea is that when the window initially loads and
populates the list, it only knows about the other users at that time.
the user would click on something that looks 'open' to them only to
find out it's not really open to them.

I'm looking for a way to make my order list more dynamic- meaning, if
user A has the order list widow open, and so does user B, I want the
window user B is using to be aware of user A's change (open a new order
for processing).

Am I on the right track? Is the list view not the right component? I
know gridview and datagrid can be sensitive to database changes, but I
cannot see how I can avoid the use of a timer in any of the above (or
will the grid component's automatically sense changes to the database
outside of themselves?).

I'm considering using some type of network communication to get these
messages across. Is this a good idea, or bad?

thanks for any thoughts- I am really stuck here. I'm concered that I
am missing something easy and obvious...

Jul 18 '06 #2
Hi

Another possible alternative for you is, instead of listing all orders
to be processed along with the name of the user currently dealing with
it (if there is one) is to have a button on your form (called something
like "Get order to process") which will pull one order out at a time
and when an order is pulled out by a user to work on you can mark this
order as 'checked out' or whatever. This way you can ensure that only
one person is working on an order at any given time and you'll only be
hitting the DB when they're ready to process an order, and they'll only
see orders that are not being worked on (plus you'll only be retrieving
one order at a time from the DB so the performance shouldn't take a
nosedive).

Alternatively you could code a queue of available orders, once a user
has 'checked out' an order to process, it gets removed from the queue
(although with this option you'll obviously have to continually poll
the DB to refresh the queue).

I suppose it really depends on what you want to achieve.

If you want all the users to be able to see all the orders, along with
details of who's working on them, you've really got no alternative than
to poll the DB frequently to ensure the view they have is up to date,
(either that or have something like the following implemented so you
only poll the DB when you know there's been a change:
http://www.codeproject.com/cs/databa...tsArticle.asp).

If you just want to stop people working on an order that's already
being processed, then don't give them the option - i.e. pull
one/five/however many orders you think they can process and flag these
as checked out so other users can't get at them.

Hope that helps
Martin

Cor Ligthert [MVP] wrote:
IdleTask,

What you're asking is the difference between pessimistic and optimistic
concurrency.
A not so simple problem to answer in a newsgroup.

Pessimistic concurrency is based on the fact that in a database two users
can update often the same data at the same time.

Optimistic concurrency is based on the fact that time has learned that the
first situation occurs in most standard situations seldom, however that
errors because of that has to be prevented, so there is a checking
afterwards if something has been changed in the meantime.

Pessimistic concurrency is very difficult to do without getting the change
on deadlocks. It has as well a very hug impact on the performance of a
database (the reason that is not anymore in AdoNet while it was in Ado).

Therefore it is in my idea better to over think your plans again.

http://msdn.microsoft.com/library/de...oncurrency.asp

I hope this gives some ideas

Cor
<id******@msn.c omschreef in bericht
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
I have an application that has many windows. One window is used for
order processing. I would like this window to display the other users
who are also performing order processing (the idea is to prevent a user
from opening an order that is being worked on by another user.

I have considered using the database:

* my query can return a user id or other identifier along with the
order record so that when I populate my list view control, I can
display the user who is working on that record.

* if the user trys to open one of these records I can tell them
'someone else has this right now'.

* I want to avoid hitting the database to update this list using a
timer control and multithreading (the reason I would do that is to
periodically update each users list view with the most current users
using whatever order).

the bad part of this idea is that when the window initially loads and
populates the list, it only knows about the other users at that time.
the user would click on something that looks 'open' to them only to
find out it's not really open to them.

I'm looking for a way to make my order list more dynamic- meaning, if
user A has the order list widow open, and so does user B, I want the
window user B is using to be aware of user A's change (open a new order
for processing).

Am I on the right track? Is the list view not the right component? I
know gridview and datagrid can be sensitive to database changes, but I
cannot see how I can avoid the use of a timer in any of the above (or
will the grid component's automatically sense changes to the database
outside of themselves?).

I'm considering using some type of network communication to get these
messages across. Is this a good idea, or bad?

thanks for any thoughts- I am really stuck here. I'm concered that I
am missing something easy and obvious...
Jul 18 '06 #3
Hey there-

Thanks for your reply. I agree w/ you and the other person's
suggestion that I rethink. Sometimes you get busy and caught up in the
problem and you can over think it :)

Pulling one order at a time is good suggestion and will work for my
needs.

Thanks again (to you and the other person as well).

Jul 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1971
by: John Wohlbier | last post by:
Hi, I have a basic programming question regarding classes in python. I want to have a list of "primaryClass" instances, and in each instance of primaryClass I would like a list of "subClass" instances. When each primaryClass instance is created I want to put one instance of subClass into the "sClasses" list (see code). The attached code is what I came up with, but it doesn't do what I want. For some reason the "sClasses" list in each...
2
1834
by: anon | last post by:
I'm aware that you can assign a value to an attribute in all class instances by assigning to <Class>.<attribute>, however, my case is slightly different and bizarre. In module node: top, left, mid, right = range(4) class Node:
20
2421
by: Bob Day | last post by:
Using VS 2003, VB, MSDE... There are two threads, A & B, that continously run and are started by Sub Main. They instantiationsl of identical code. Thread A handles call activity on telephone line 1 and Thread B handles call activity on telephone line 2. They use a common SQL datasource, but all DataSets are unique to each thread. Is there a way for thread A to occasionally communication to thread B that something has happened? ...
0
1089
by: marc.derider | last post by:
I was making a change to a Web service. It was something extremely trivial, such as adding a single parameter to extend the functionality exposed through that method. It got me to thinking however if there was a standard methodology for advertising and of course subscribing to changes. E.g. is there a standard for publishing/notifying changes that are made to a web service. I think that with all the supposed great push towards a more...
18
1295
by: Daniel | last post by:
My previous thread got very large so here is my point again, but a better example of my problem: SceneChair chair = (SceneChair)_objMan.GetObject((int)ObjectID.Seats); chair.Position = GetSeatPosition(1); chair.FrameNum = 1; _objMan.AddToRenderStack(chair);
6
9889
by: dtschoepe | last post by:
Hi all, Working on homework again... I've got a weird problem, I've been banging my head against the wall on what is causing it. I have a pointer to a typdef named Person. At one point in the code the pointer changes from storing the memory location of the Person and contains the value '1'. I have commented out several pieces of code in order to try to
0
1291
by: velu5 | last post by:
Hello, I want to enumerate all the RUNNING SQL instances using SQL DMO. But any of the following methods would not help ListAvailableSQLServers Method ListInstalledInstances Method because they list all the installed instances and while my intent is getting only the running instances.
0
1464
by: Alex N | last post by:
My question relates to one of the previous ones, http://bytes.com/topic/c-sharp/answers/545389-saving-properties-settings-dll-project If i want to share a single <app>.exe.config file among several networked running instances of the same app, how can i save changes of an application-scope settings so other instances after Reload or unexpected reboot will have latest values?
1
3285
by: edurazee | last post by:
Suppose I am in a network. One or more MySQL services are running on a machine/several machines in the network including the localhost. How to write a C# code to list/enumerate the names of all the running instances of MySQL?
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.