Re: Indirect Sync A97 - Replication Manager
- From: "Tom Stoddard" <tomshome@xxxxxxxxxx>
- Date: Sun, 1 Jan 2006 19:55:17 -0500
> Is it true that Microsoft has now made the files necessary to
> implement indirect synchronization for A97 public? Does that mean it
> is no longer necessary to purchase a copy of a Developer's version to
> legally implement A97 indirect replication? I assume the combination
> of Microsoft's publicly available files and MichKa's TSI Synchronizer
> would be used to make indirect replication possible.
>
> Yes? No? Maybe? Other?
>
I've recently spent some time implementing indirect synchronization in a
project I'm working on. I wanted to be able to configure my application to
control synchronization programatically and to support both direct and
indirect methods. I spent a lot of time experimenting with the TSI
synchronizer and found that I could do just about everything I wanted to do
by using it's properties and methods. However, I encountered some problems
which I was not able to solve which forced me to use JRO and some querying
of a system table to work around. I'll try to give you a quick overview of
what I learned.
There are people who have said that indirect synchronization can now be
accomplished without installing Replication Manager but I have not been able
to do that with Jet 4.0. The reason this is being said is that there is an
update to replication manager which includes the jet synchronizer
(mstran40.exe). It's true that if you download the service pack,
jet40repl.exe, and install it, you will have a directory on your computer
which will include the synchronizer. You can even start and stop it by
double clicking on the file itself in windows explorer. You might be able to
use the synchronizer with JRO at this point but you will not be able to
control it using the TSI Synchronizer. I should explain that JRO has a
method for initiating indirect syncrhonization which I do use but I never
tried using it before I installed Replication Manager. That's why I said the
JRO might work. However, before you can use the JRO method you need to set
up a drop box on your computer. The easiest way I've found to do this is by
using the TSI Synchronizer. I believe, however, that all that it does is to
set a registry setting in the Transporter key under the jet 4.0 key. I have
never tried to set this manually so I don't know if that is all that is
needed or not. You would also need to make sure the synchronizer is running
before you try to do indirect synchronization. The TSI object has a way of
doing this, JRO does not.
I tried installing the service pack alone without having Replicaton Manager
installed and here's what happened: The TSI synchronizer object has a
property called "running" which when set to true will start the jet
synchronizer and when set to false will stop the jet synchronizer. The jet
sychronizer must be running in order for an indirect sychronization to
succeed whether you initiate the syncrhonization with the TSI Synchronizer,
JRO or even Replication Manager. With only the service pack installed, when
I try to execute the line of code "sync.running = True" I get an error
stating that the synchronizer could not be found. As soon as I install
Replication Manager I can run the same code with no error and the jet
sychronizer starts and stops on command. I can't figure out what Replication
Manager does to enable the TSI Synchronizer to be able to find the jet
synchronizer. I tried adding a Replication Manager key to the registry
manually and putting a SynchronizerPath key in it with a path to the jet
synchronizer file but that didn't work. When I install Replication Manager
it does exactly that and the TSI object begins to work. This tells me that
something else is being done when Replication Manger is installed. I don't
know if that something else is the installation of a file or the
registration of a dll or a registry key or something else. All I know is
that the TSI synchronizer can start and stop the jet synchronizer once
Replication Manager is installed.
Now for the next problem I encountered. After installing Replication Manager
I could then synchronize indirectly by using the "synchindirect2" method of
the TSI Synchronizer object. There are two methods available, one is
"synchindirect" the other is "synchindirect2". The difference is explained
in the help file. Basically I needed to use 2 because I wanted to be able to
let the user know whether or not the synchronization succeeded and I also
wanted to know when it was safe to stop the jet synchronizer from running.
The synchindirect2 method returns an ExchangeID which can be used to get a
HistoryItem object which has a status property which will let you know what
the current status of the synchronization attempt is. I got everything to
work flawlessly by using a timer event in the form I use to perform the
synchronization. In the timer event I would check the HistoryItem.status
every second until it returned either success, failure or cancel at which
time I would report that to the user and stop the jet synchronizer from
running by using the TSI Synchronizer object. I thought I was finished but
then I decided that I would use the same form to enable the user to compact
and repair the back end database as well as perform the synchroniztion. I
discovered that when I attempted to compact the database after using the TSI
Synchronizer object to do an indirect synchronization that I would get an
error. For some reason, after the synchronization, an ldb file is left in
the database directory which indicates that the database is opened by
another user and this prevents me from being able to compact and repair the
database. The only way I could get the ldb file to disappear was to close my
front end application and then reopen it.
My solution to this problem was to use JRO instead of TSI to initiate the
indirect synchronization. I still use TSI to configure the settings I need
such as the drop box folder and the databases which the synchronizer is
managing and I still start and stop the jet synchronizer by setting the TSI
running property. I only use JRO to do the actual synchronization. When I do
this, the ldb file disappears as soon as the synchronizer is stopped. Don't
ask me why, it just works. However, now that I'm using JRO in can't use TSI
to get the ExhangeID so that I can track the status of the synchronization.
Instead, I studied the MSysExchangeLog system table and found that I could
query it and get the same information the the TSI HistoryItem gave me
before. So now I query the MSysExchangeLog table of the database I'm
synchronizing immediately after initiating the synchronization to get the
ExchangeID and then I query it repeatedly in my timer event to check on the
status until the status indicates that the synchronization is complete.
This has been a long tedious process. It's not easy figuring this out
because you have to have two separate computers set up and running just in
order to test it. The most frustrating aspect is the almost complete lack of
documentation on the subject. There's plenty of high level explanation about
replicaton but very little documentation on the details behind the scenes.
It's very disappointing to me that Microsoft hasn't done a better job than
they have with the documentation of indirect replicaton and the jet
synchronizer. I want to thank Michael Kaplan for making his TSI objects
available. Without them I would never have figured out as much as I did. If
Microsoft really wanted to make replicaton more available to Access
developers they would have included all of the methods that the TSI objects
contain in JRO. There's no reason why the couldn't have. They obviously
don't want to make it easy for us. I can only assume they do this for
financial gain. I guess they haven't gotten enough of our money yet.
.
- Follow-Ups:
- Re: Indirect Sync A97 - Replication Manager
- From: I Need Help
- Re: Indirect Sync A97 - Replication Manager
- From: David W. Fenton
- Re: Indirect Sync A97 - Replication Manager
- From: David W. Fenton
- Re: Indirect Sync A97 - Replication Manager
- Prev by Date: Re: FE/BE Replication Question
- Next by Date: Re: Indirect Sync A97 - Replication Manager
- Previous by thread: Re: FE/BE Replication Question
- Next by thread: Re: Indirect Sync A97 - Replication Manager
- Index(es):
Relevant Pages
|