?
Solved

Database Replcation / Sync'ing

Posted on 2004-08-24
6
Medium Priority
?
244 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 300 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 900 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Assisted Solution

by:Eamon21
Eamon21 earned 300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

719 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