Application + Remoting +Terminal Server Issue. Help
-
Hi All, I am working on a C# windows application which uses a MySql db as back-end. it is a huge solution with 100 forms. Everything was fine until last week When I was told, " there is a chance this application will be used my multiple users and same forms can be opened simultaneously(from different machines)". so My application was not designed in such a manner that it can handle multiple user access same data and modify it at the same time. For ex: if one user creates/edits/deletes a record then the other user can not know that a record is created/edited/deleted on the same form. I thought of using remoting. A windows service on the DB server will have the "users + forms opened" list. As the user logs in and tries to open a form, my application will connect to service and check for, if that form is already opened by some one else. if true, then it will open form in a lock mode. But the problem is, if some one opens the form in lock mode and then the form should be notified once it is unlocked. How should i implement this? I read few articles on Remoting and invoking events but everybody says that it is not a suitable way. What can be other ways please suggest ? Added to this now i came to know that the application will be run on a terminal server :doh:. I tested it on terminal server to see if there are any issue, I found, when my application if run by multiple users can't write to the config file. Only the user who installed it can write into the config file. I thought it is a permission issue which can be resolved. Then i read few posts stating .Net application performance degrades when run on a terminal server. in the sense that Memory consumption is too high. Well i have not tested it for sure. but Will there be any problem with the Remotng part if both the service and my application run on the same terminal server ? Will there be any performance issue ?:confused: I am worried because my application is already using 100 mb of memory. I have very little time left please help Thanks
KSS
-
Hi All, I am working on a C# windows application which uses a MySql db as back-end. it is a huge solution with 100 forms. Everything was fine until last week When I was told, " there is a chance this application will be used my multiple users and same forms can be opened simultaneously(from different machines)". so My application was not designed in such a manner that it can handle multiple user access same data and modify it at the same time. For ex: if one user creates/edits/deletes a record then the other user can not know that a record is created/edited/deleted on the same form. I thought of using remoting. A windows service on the DB server will have the "users + forms opened" list. As the user logs in and tries to open a form, my application will connect to service and check for, if that form is already opened by some one else. if true, then it will open form in a lock mode. But the problem is, if some one opens the form in lock mode and then the form should be notified once it is unlocked. How should i implement this? I read few articles on Remoting and invoking events but everybody says that it is not a suitable way. What can be other ways please suggest ? Added to this now i came to know that the application will be run on a terminal server :doh:. I tested it on terminal server to see if there are any issue, I found, when my application if run by multiple users can't write to the config file. Only the user who installed it can write into the config file. I thought it is a permission issue which can be resolved. Then i read few posts stating .Net application performance degrades when run on a terminal server. in the sense that Memory consumption is too high. Well i have not tested it for sure. but Will there be any problem with the Remotng part if both the service and my application run on the same terminal server ? Will there be any performance issue ?:confused: I am worried because my application is already using 100 mb of memory. I have very little time left please help Thanks
KSS
fearless stallion wrote:
I thought of using remoting. A windows service on the DB server will have the "users + forms opened" list. As the user logs in and tries to open a form, my application will connect to service and check for, if that form is already opened by some one else. if true, then it will open form in a lock mode. But the problem is, if some one opens the form in lock mode and then the form should be notified once it is unlocked. How should i implement this? I read few articles on Remoting and invoking events but everybody says that it is not a suitable way. What can be other ways please suggest ?
Your problem isn't going to be handled by "locking forms". That just complicates things beyond what is necessary. This issue is data concurrency. As your application stands now, every user can open look at anyn data they want and modify it, all at the same time. The problem comes when the users start writing that data back to the database. Right now, your app can only do "last write wins". The last write back to the database overwrite any changes made by anyone else. It someone else is looking at the same data, they will NOT get notified of the change. This is normally solved by adding a timestamp field to each table in the database that's shared by multiple users. In the SQL code that writes the changes back to the database, each row's primary key is used in the SQL's WHERE clause to locate the record to update, but you also include the date/time that was read from the database in the WHERE clause. If the date/time is different than the one you got, the record will not be found, meaning someone else has updated the database while you were looking at the data. What you do in that situation is up to you. Try reading this[^] and this[^] and this[^] and a few articles from this list[[](</x-turndown)
-
fearless stallion wrote:
I thought of using remoting. A windows service on the DB server will have the "users + forms opened" list. As the user logs in and tries to open a form, my application will connect to service and check for, if that form is already opened by some one else. if true, then it will open form in a lock mode. But the problem is, if some one opens the form in lock mode and then the form should be notified once it is unlocked. How should i implement this? I read few articles on Remoting and invoking events but everybody says that it is not a suitable way. What can be other ways please suggest ?
Your problem isn't going to be handled by "locking forms". That just complicates things beyond what is necessary. This issue is data concurrency. As your application stands now, every user can open look at anyn data they want and modify it, all at the same time. The problem comes when the users start writing that data back to the database. Right now, your app can only do "last write wins". The last write back to the database overwrite any changes made by anyone else. It someone else is looking at the same data, they will NOT get notified of the change. This is normally solved by adding a timestamp field to each table in the database that's shared by multiple users. In the SQL code that writes the changes back to the database, each row's primary key is used in the SQL's WHERE clause to locate the record to update, but you also include the date/time that was read from the database in the WHERE clause. If the date/time is different than the one you got, the record will not be found, meaning someone else has updated the database while you were looking at the data. What you do in that situation is up to you. Try reading this[^] and this[^] and this[^] and a few articles from this list[[](</x-turndown)
Dave Kreskowiak wrote:
Basically, you've got a HUGE problem to fix, but no time to do it. I think it's time to tell management to face reality, because you're going to need more time to redesign your applications data layer. I'd tell them after you read this stuff and show them a plan of attack on the problem, 'cause there is no "quick fix" for this.
Thank you very much Dave. Yes there is no immediate solution to this problem. and i will go through the links. i will let you know once i am done with the links thanks again
KSS