|
Comments
|
Today's Top SOA Links
Techniques A Mobilink Primer
What is it?
By: Deanne M. Chance
Oct. 31, 2006 01:45 PM
A session-based synchronization technology designed to synchronize UltraLite and Adaptive Server Anywhere databases with many industry-standard SQL database management systems from Sybase and other vendors.
How Does It Work?
Mobilink Commands
C:\>dbsrv9 -n BLConsolidated blconsolidated.db The first command starts the consolidated database server. The second starts the Mobilink synchronization server. The last is the command issued by the client to start the synchronization process.
How Do We Tell It What To Sync? If you look in Sybase Central you can see the definition of our multi-site publication. It's listed under publications and is called Booklog. You must specify which tables and columns you want to replicate. A wildcard publication is specified by the '*' and indicates all columns. These are bad though because as you'll see on the server we must define what columns are going to be received from the client. The ordering of these two must match. If they don't the scripts won't work. So consider the addition of a column to a table without modificating the server-side scripts, if you have a wildcard publication, well, you just broke synchronization for that table.
What Are the Server-Side Scripts and What Do They Do?
How Does Mobilink Know What Changes Have Occurred on the Client? Let's look at the relationship between a Mobilink publication and server-side scripts for the color_tb. First the client publication, (remember this is stored on the remote db), it has two columns published as part of its article. They are co_code and co_desc. Again you can look at it if you connect to the remote database using Sybase Central and look under the publication tab. Now, the server-side scripts (remember this is stored on the consolidated db), it has the three scripts we discussed earlier. Once again, you can look at them if you connect to the Mobilink synchronization service and look under the synchronized table tab for the color_tb. Next we 'll look at how columns are added to articles in the publication and how server-side scripts are added to consolidated in code. This work is done in the upgrade scripts for client and server programs respectively.
How to Modify the Server-Side Scripts in the Upgrade Object for the color_tb
The question mark is a placeholder for the data that's sent to consolidated. It will be sent in the order in which it's defined in the table. That's why the order of your scripts must match what's defined by the remote table definition. For the upload_update event you'll specify the primary key as part of the where clause. For the upload_insert event, we call a stored procedure to do the insert, but we didn't have to. It's just one technique for making the insertion into consolidated. An INSERT statement could have been used instead. Now for a closer look at the stored procedure used to add server-side scripts, ml_add_table_script(....)
Function ml_add_table_script(version VARCHAR(128), table_name VARCHAR(128), event VARCHAR(128), script TEXT)
Description To delete a table script, set the script parameter to NULL. What Does That Modified Stored Procedure for the update_insert Event Look Like?
ALTER PROCEDURE "GROUP1"."AddColor"
Resources Reader Feedback: Page 1 of 1
Your Feedback
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||