G
Guest
Hi,
I have been written an application in visual studio 2003 (c# winforms)
with microsoft SQL Server. Cuncurrency is what I have somewhat problems with.
I have though about the following to make my application the closest to real
time possible that way everybody can have the most current data. I would like
your opinion, because I implement this.
First of all, because a bring data in chunks into the dataset, at
times, a user "A" may update the data and user "B" will not now that this
happen. There is of course a way of knowing after user "B" updates, because
if the update is protected on the where statement (update..... where
fielda=@fieldA and fieldb=@fieldb and so on), I could give a warning message
and refresh data. I find this method not to be useful for all applications.
So, what I have in mind is the following.
1) Try to have data bring back to the client every time they activate a screen
2) Create a class where using sockets or alike type of communication to
inform all the users when specific tables and or screens have been update and
take action to this. each user will have 2 extra threads , one for listening
and one for sending the message, apart from the main thread where the
application is running.
3) Always check the records before updating
4) In a PO Screen for example, where the user may be editing one of them,
try to lock if possible the record, from the other users.
5) There is one more problem, which are some processes that need cursors.
where I need to loop and update accordanly. I would like to provide some type
of lock for the record that is reading on the loop, to prevent problems.
I would like to know your input, specially if you think I'm crazy.
Thanks
I have been written an application in visual studio 2003 (c# winforms)
with microsoft SQL Server. Cuncurrency is what I have somewhat problems with.
I have though about the following to make my application the closest to real
time possible that way everybody can have the most current data. I would like
your opinion, because I implement this.
First of all, because a bring data in chunks into the dataset, at
times, a user "A" may update the data and user "B" will not now that this
happen. There is of course a way of knowing after user "B" updates, because
if the update is protected on the where statement (update..... where
fielda=@fieldA and fieldb=@fieldb and so on), I could give a warning message
and refresh data. I find this method not to be useful for all applications.
So, what I have in mind is the following.
1) Try to have data bring back to the client every time they activate a screen
2) Create a class where using sockets or alike type of communication to
inform all the users when specific tables and or screens have been update and
take action to this. each user will have 2 extra threads , one for listening
and one for sending the message, apart from the main thread where the
application is running.
3) Always check the records before updating
4) In a PO Screen for example, where the user may be editing one of them,
try to lock if possible the record, from the other users.
5) There is one more problem, which are some processes that need cursors.
where I need to loop and update accordanly. I would like to provide some type
of lock for the record that is reading on the loop, to prevent problems.
I would like to know your input, specially if you think I'm crazy.
Thanks