Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Replication / December 2007

Tip: Looking for answers? Try searching our database.

Homegrown Synchronization Followup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rdemyan - 24 Dec 2007 16:40 GMT
Just a followup on how well this "homegrown synchronization" is
working.

It has been in use for over 6 months and there have been only a few
problems:

1) The client got all new computers and finally upgraded the operating
system.  All the issues I had before with a slow startup of the
application (because temporary copies of the backend files had to be
created) are now moot.

2) I've actually been able to update the backend files from a
synchronization application located on a PC that is over 1200 miles
away from the server backend files.  This typically takes 35 to 45
minutes as opposed to 2 minutes when doing the synchronization at the
location where the server is.  However, this is not generally
recommended since a dropped line will corrupt the back-end files.

3) One instance of corruption occurred while synchronizing the server
back-end file with an update file. This occurred from a location about
20 miles from the server (typically takes 10 to 15 minutes to
synchronize).  However, since the synchronization process always
creates a backup copy of the server backends, it was relatively easy
to fix this problem.

One issue I didn't consider:  If a user is logged into the backend
files located on the server and not their local PC and they make
changes to data on the server backend files, how are zipped copies of
the backend files generated (which files are then sent out to all
users when they log in to MyApp and is used to replace the LOCAL copy
of the back-end files).  In other words, is there a reliable way to
tell when the server back-end files have been updated?  If so, I could
then just create a text file and store it in the server folder.  As
part of the timer function in the SyncApp, if this text file is found,
code would be executed to create zipped copies of the server back-end
files which would then be sent to the users when they log in.

It's important to note that I previously chose to send zipped copies
of the entire back-end files, not just incremental changes.  If there
is a reliable way to determine if the server back-end files have been
updated, then it would be relatively easy to just invoke the code that
creates these zipped back-end files and puts them in the Server
Outbox.

Would checking to see if there is a difference in the "Date Modified"
of the server back-end files provide a reliable way to check if the
server backend files have been changed.  If so the process might be as
follows"

MyApp would record the "Date Modified" of the server back-end files
when a user first logs on.  Then when MyApp is closed, the "Date
Modified" is checked again.  If different, then changes were made (is
this true??).  If changes are made, the code generates a text file and
puts in the Server Inbox.  The SyncApp is monitoring the Server
Inbox.  If it finds the text file, the code will then create zipped
copies of the backend files and put them in the Server Outbox.   This
whole process is exactly what the SyncApp currently does anyway,
except that an update file from a user's local PC backends is not
applied to the server back-end files.

So the question I have is, how does one reliably determine when a back-
end file has been updated (assuming that there is no code in MyApp
that does this).
David W. Fenton - 24 Dec 2007 20:47 GMT
rdemyan <rdemyan@hotmail.com> wrote in
news:4f8c6f40-8b60-4a5d-bdf0-3fef4ad22a0b@e25g2000prg.googlegroups.co
m:

> Would checking to see if there is a difference in the "Date
> Modified" of the server back-end files provide a reliable way to
> check if the server backend files have been changed.

Maybe. I just tested whether or not opening a table in a back end
from a front end changes the date of the back end, and it doesn't,
so a change to the date of the back end would indicate changed data
*if* the users can never open the back end directly.

I'm not sure I'd want to rely on this.

One option would be to log user login/logout and use that to see if
the user has made any changes. You might also implement a global
IsUpdated flag that is changed to True in the AfterUpdate of all
your data entry forms. You'd then record that in the logout. That
would give you a pretty reliably homegrown method for tracking
updates and would, I think, be more reliable than using the file
system date. Of course, you'd want to make sure your logging table
was *not* in the back end!

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

rdemyan - 25 Dec 2007 16:21 GMT
On Dec 24, 12:47 pm, "David W. Fenton" <XXXuse...@dfenton.com.invalid>
wrote:
> rdemyan <rdem...@hotmail.com> wrote innews:4f8c6f40-8b60-4a5d-bdf0-3fef4ad22a0b@e25g2000prg.googlegroups.co
> m:
[quoted text clipped - 22 lines]
> David W. Fenton                  http://www.dfenton.com/
> usenet at dfenton dot com    http://www.dfenton.com/DFA/

Hi David:

Nice to see you are still maintaining this group.  It's been a while
since I checked in and I noticed a lot of spam.  Before I get to the
topic at hand, I wanted to mention that one thing that really helps
the Homegrown Synchronization method is the use of a zipping program
to move files from the server to the local PC and vice versa.  This
reduces file size by almost a factor of ten and I haven't had any
complaints from any users regarding the time it takes to "download"
new complete back-end files from the server.  Even at the location
1200 miles away, it doesn't take any longer than about 2 to 3 minutes
to download the BE files (almost 20 MB in total).

I don't see how just recording the login and logout tells me if the
backend files have been modified.  Your second suggestion won't work
for me either, because MyApp was not designed to handle this method.
We discussed your suggestion almost a year ago and it would have just
involved too many code changes (Virtually all of my forms are unbound
and I use code to handle table changes).  This was the reason I
originally decided to create a temporary copy of the BE files and just
create one code module that upon closing of MyApp would compare the
current local BE files with the temporary BE files (created at
startup) to see if their are changes. If changes, then a small zipped
update file is created and copied over to the Server Inbox.   If I had
designed MyApp at the beginning to use your suggestion it would have
been better, because determining if updates were made would be easy
and fast. But retrofitting it in after 18 months of work was just too
difficult.  Also, now that the client has finally updated all machines
and gone to Windows XP professional, speed is hardly an issue when
creating the temp local copies and checking for changes upon closing
MyApp.  The SyncApp can still be slow because it is a local copy (IT
won't allow any apps to run continuously on the server) and depending
upon the distance from the server.  But it doesn't really matter
because no one uses the SyncApp for accomplishing work.  It
essentially runs in the background on their local PC.

It just occurred to me that I could treat the server back-end files
like the local PC back-end files when it comes to checking for
changes.  So when a user logs in and connects to the server BEs, a
local copy of these BEs is made.  Then when the user logs out of the
server BEs, the code checks for differences between the server BEs and
the local temporary copies of these BEs (this is exactly what is done
when a user connects to LOCAL copies of the BEs). If a difference,
create an updateDB and put it in the Server Inbox.  The SyncApp will
find the updateDB and apply it just like always.  It seems that the
code changes in this case would be minimal since the hidden startup
form of MyApp has text boxes that contain the Local PC folder, Server
folder and if the user is connected to the server BEs or the local
BEs.

Two issues come immediately to mind:

1) If someone else is logged into the server BEs, then VB code won't
be able to create a temporary copy (the copy is only for the
session).  I believe, however, that Window API copy command will.  But
this no doubt will increase the chances of corruption.
2) Higher likelihood of corruption when creating the temporary BEs on
the local PC from the server BEs.

1) seems more likely to be the problem.  However, currently only one
person besides me has been connecting to the server and that's only
because he wasn't setup correctly to use his local copy of MyApp.  He
was actually logging on to the server copy of MyApp (which, of course,
Microsoft discourages).  Everyone prefers the speed afforded by
handling all connections on the local PC.

Since Homegrown Sync is working well, maybe I shouldn't allow users to
connect to the server unless they are administrators of MyApp.  After
all, any change they make on the local copy creates an update file
that is sent to the server inbox.  The update file name includes their
User ID, so I can see who is actually making changes to data just by
looking at the files in the server folder.  This allows me to
administer the program better.  If a user consistently changes data
because they don't understand how the app works, I can demote them to
a User Group that does not have permissions to send updates to the
server.  So they can change their local copy of the data to their
heart's content and it will never affect the server (except of course
if they actually use Windows Explorer to copy over the server BEs; no
way to stop that except switch to SQL Server, Oracle, etc).  Then
periodically when they log in, updated BEs (created as a result of
someone else updating data) is sent to them anyway; this is at least a
once a month event.

So far this hasn't been an issue, because frankly, I'm the only one
who knowingly connects to the server BE files.  On the MyApp Logon
form, I included code that notifies a user if they have selected to
connect to the server BE files.  The message informs them that the
connection speed could be slow and gives them the chance to change
this selection so they can go on logging into their local copy of the
BE files.

Now that I've completed this message, I'm leaning towards not allowing
certain user groups to connect to the server BE files.  At this point,
nobody really wants to anyway, because they prefer the speed afforded
by connecting to local copies of the BE files.  Just an aside: this
speed is an important issue because MyApp is calculational intensive.
Hardly any forms just display data directly from a single table.
Virtually every form pulls data from multiple tables and many forms
have to perform calculations/comparisons of data before it is
displayed.  Also,  most forms deal with tens to hundreds of thousands
of rows of data upon which calculations or comparisons are done prior
to display (the displayed amount of information is generally much
smaller).  To keep users continuing to use MyApp, I've always felt
that speed is of paramount importance.

Have a nice holiday.
David W. Fenton - 25 Dec 2007 23:41 GMT
rdemyan <rdemyan@hotmail.com> wrote in
news:64045c23-37c9-48e0-99d8-2f6f88276598@s19g2000prg.googlegroups.co
m:

> 1) If someone else is logged into the server BEs, then VB code
> won't be able to create a temporary copy (the copy is only for the
> session).  I believe, however, that Window API copy command will.
> But this no doubt will increase the chances of corruption.

No, Windows APIs won't do any better than VBA code that uses the VB
file copy. The only safe way to duplicate an MDB that is in use is
to use Jet to copy the data. That won't necessarily produce an exact
copy (if there are locked records, those may not be copied over),
but it will never produce a *corrupt* copy.

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.