Solved

Database Replcation / Sync'ing

Posted on 2004-08-24
6
239 Views
Last Modified: 2010-04-15
We have an application where users sign in like a punch clock. This punch clock is pretty simple, saves the sign in time and the sign out time.

The problem we are having is that if the server goes down for any reason no one can login or out, as it won't update the database.

Is there a way to save this data to a file on the local machine and when the network is avalible then it will sync with the database?

0
Comment
Question by:jvoros1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Assisted Solution

by:somnatic
somnatic earned 100 total points
ID: 11880600
only an idea ..

write the database calls (SQL Statements) into a file and every 5 minutes (or so) feed them to the database .. if the action was successfull, flush the file .. otherwise .. keep the file and append the rest and try again 5 minutes later ..
0
 

Author Comment

by:jvoros1
ID: 11883570
that might work... but i also have to read from the database as well (return user names) .. would i beable to query the database to a file, then read form the file and then reupdate?
0
 
LVL 1

Accepted Solution

by:
cdmackie earned 300 total points
ID: 11886015
SQL Server?

If so, then it provides in built replication and synchronization capabailities where you can have a mixture of publisher/distributor/merge type databases.

Suggest you start with the Replication help in the manuals/books on-line to get the general feel. Then you can go about setting up your replication tables (in the 'Publisher') and assign your clients (the 'Subscribers'). There are also several models, and perhaps something to keep everything fully-synchronized would be best for you app - depending on the number of clients, etc.

To start, go into Enterprise Manager, Replication, Publications and right-click to create a new publication.

A word of warning, though, it can be a hair-pulling experience because the servers have to be set up right...it'll either work straight-away or not at all and you won't know why!!!...from bitter expereince, but I can help you later with some tips!


Colin
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Assisted Solution

by:Eamon21
Eamon21 earned 100 total points
ID: 11888190
Why not create a dataset with the same structure as your database, when the program loads, it can read/refresh the dataset from the server if it is available.  You can then use the dataset as an in-memory copy of the database and when changes are made, attempt tp update back to the server.  If this fails, the changes will still be marked in the dataset as added, modified or deleted rows.  When the program shutsdown, you can then use DataSet.WriteXML() function to persist it to local disk.  To ensure that the rowstates are saved, use System.Data.XmlWriteMode.DiffGram as the write mode.

Next time the program starts, create a new dataset and ReadXML() from this file, if the server is available, you can update now and any previous changes will be sent to the server.

Eamon
0
 

Author Comment

by:jvoros1
ID: 11901867
Thanks for the help guys. I'm going to have to look into it. I'll divide up the points soon.
0
 

Author Comment

by:jvoros1
ID: 12044109
I'm still sketchy on how to do this properly, but im sure all of these would work.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question