|
-
Jul 9th, 2009, 01:42 AM
#1
Some DataSet Questions
currently I'm working on TCP/IP program, the clients will be about 1000 terminals and during the day they will keep sending TCP/IP strings with approval requests, the server will examine those request with the client terminal data stored in SQL database and will send back a true or false.
since the database of those terminals is changing only about 5-10 times a day i choose to load the information into dataset once the program start and re-populated it every 30 minutes, now I'm facing two questions:
1) is the way i've choose is the correct way? i mean is querying a dataset is much faster then querying SQL Database.
2) what will happen if a client will try to connect and use the stored dataset in exactly the same time that my program is re-populated the dataset.
Thanks.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 01:45 AM
#2
Re: Some DataSet Questions
To answer your first question, it depends on how busy the server gets.
To answer the second question, you should have a method inside both the client and server that will 'pause' the client while the server is updated.
-
Jul 9th, 2009, 01:55 AM
#3
Re: Some DataSet Questions
To answer your first question, it depends on how busy the server gets.
To answer the second question, you should have a method inside both the client and server that will 'pause' the client while the server is updated.
Well the database will be quite busy, and in every trip to the database i need to perform some heavy use with number of query's.
once again, the question remains is querying dataset is much faster then querying SQL database? if dataset is stored in memory then i guess querying DataSet is much faster, but i'm not sure about that.
Now, I already thought of the idea to hold the clients requests while the dataset is been re-populated and i guess this is what i'm gonna do, i just wanted to know what will happen in case the the application try to use a dataset that is in the process of been re-populated.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 04:58 AM
#4
Re: Some DataSet Questions
If you try to access something that is being used by another process, you'll probably get an exception.
As for your busy database, go ahead and do the Dataset, which would be stored in memory. I'd assume it would be faster to do that than just to query the db directly, but you better let your customers/clients know the main database won't be updated instantly. You also need to have a backup plan in case the server unexpectedly shuts off, which would lose all those changes if the db wasn't sync'd at the time.
-
Jul 9th, 2009, 05:07 AM
#5
Re: Some DataSet Questions
Well no changes are going to made to the data that stored in the dataset it's only for retrieving information so no problem there.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 05:13 AM
#6
Re: Some DataSet Questions
Well in that case, I'd assume you're good to go if the Dataset was just for querying.
What would the database actually store, if I can ask that.
-
Jul 9th, 2009, 05:21 AM
#7
Re: Some DataSet Questions
 Originally Posted by formlesstree4
Well in that case, I'd assume you're good to go if the Dataset was just for querying.
What would the database actually store, if I can ask that.
Mostly company's, employee, terminals and BINS informations.
Changes to the Database will only be made through the backoffice in our office.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 05:22 AM
#8
Re: Some DataSet Questions
Answer to #1 is yes... it's stored in memory so it's accessible faster.
The problem, though - How are you going to handle conflicts? If two users have the same data in memory and they both edit the same row, what will you do? You could use Sql Server Notification Services, have your apps subscribe to it and refresh data when a change occurs.
-
Jul 9th, 2009, 05:27 AM
#9
Re: Some DataSet Questions
 Originally Posted by mendhak
Answer to #1 is yes... it's stored in memory so it's accessible faster.
The problem, though - How are you going to handle conflicts? If two users have the same data in memory and they both edit the same row, what will you do? You could use Sql Server Notification Services, have your apps subscribe to it and refresh data when a change occurs.
Hi Mendhak,
As I wrote in earlier post, there are no changes going to made to the data that is stored in the dataset.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Jul 9th, 2009, 05:40 AM
#10
Re: Some DataSet Questions
You can still use SSNS to get your 'updates'. If the app is reading from the database, then it depends on how the database is being populated. If the populating procedure locks the table, then the app will need to wait. If it's doing a nolock or a transaction isolation level read uncommitted, then your app will get data regardless of the update which may mean that some rows are out of date.
-
Jul 9th, 2009, 05:44 AM
#11
Re: Some DataSet Questions
Ok, many thanks for this advice can you provide me some link of how to start learning of the SSNS technology since i never used it before.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|