Results 1 to 11 of 11

Thread: Some DataSet Questions

  1. #1

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  2. #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.

  3. #3

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  4. #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.

  5. #5

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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

  6. #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.

  7. #7

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: Some DataSet Questions

    Quote Originally Posted by formlesstree4 View Post
    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

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  9. #9

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: Some DataSet Questions

    Quote Originally Posted by mendhak View Post
    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

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  11. #11

    Thread Starter
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    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
  •  



Click Here to Expand Forum to Full Width