HI.
It appears that Nexusdb fórums treat any question about data replication as if were radioactive. Nobody touches it.
I hope some courageous soul would look at this scheme of data replication to another PC (PC2) on the same LAN .
Maybe I am way off: if so an answer “Yes, you are way off” would suffice
Have 2 identical data modules, DM1 with aliaspath pointing to the working directory, and DM2 with aliaspath pointing to a backup directory on another PC and running on a separate thread. The datasets in both DM's are identical.
I also have a unit (Unit0)accessible to both data modules where I store
some variables and structures/records.
Each table has a field NOT autoinc "DR" wich is a unique number
identifying each record, and an index based on it.
I put
A) a "GlobalBeforePost" on each table in DM! which saves the dataset state
(dsEdit or dsInsert), the record buffer and the "DR" value to Unit0,
B) a "GlobalAfterPost" on each table in the first data module (DM1) which calls a function in Unit0.
The pseudo code in the function in Unit0 is:
Retrieve the dataset state and "DR"
If state = dsEdit then begin
If not Findkey(DR]) then
Raise error
End else
Append
Retrieve record buffer and copy it to the corresponding table in DM2
Post.
The entire operation is inside a starttransaction /commit/except.
If this scheme is somewhat feasible, I have 2 questions:
1. Could there be a conflict if 2 users at the same time attempt to update
the same table?
2. How do you Save/Copy a record buffer?