cancel
Showing results for 
Search instead for 
Did you mean: 

Preloaded data

Former Member
3,062

Good Afternoon, I'm newer in mobilink technology so I don't know if my question is valid:

I have to load default data on the ultralite database, to avoid init synchronization(because is large amount of data) But mobilink is going to download all the data because in ml_subscription table is no reference of the lastdownload date. How can I achieve this? Is it possible? Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

philippefbertrand
Participant

Assuming the database that is embedded in the resources is empty ("fresh database") and has never been synchronized, you simply need to synchronized it - the first sync will set the remote id and last download timestamp.

If you want to embed a pre-populated database and you are not worried about building it regularly, you can use Sybase Central to perform the first sync, then use Sybase Central or dbisql to reset the remote id (see 3.2 below) before embedding into the resources.

If you want to build it regularly:

  1. One-time build an empty database (Sybase Central or ulload command line tool or ulinit command line tool) - call it A.udb
  2. Build process:
    1. copy A.udb B.udb
    2. ulsync B.udb (see documentation on command utility ulsync for usage)
    3. embed B.udb into resources
  3. Client app:
    1. copy the udb out of the resources
    2. execute the following SQL: SET OPTION ml_remote_id =
    Database is now good to use

What version of UltraLite and what API are you using?

philippefbertrand
Participant
0 Kudos

If this answers your question, please mark it as accepted so we know we have resolved this.

Former Member
0 Kudos

Philippe when I try to execute 3.2 I get a Syntax Error SQLCODE = -131. I´m using version 10 of Ultralite

philippefbertrand
Participant
0 Kudos

ml_remote_id was introduced in 11.0.1. For your version, the client just has to make sure he/she synchronizes with a unique ML user id.

Answers (2)

Answers (2)

Former Member

The key is to create the initial database by synchronization, instead of otherwise, because the official last download time is stored at the remote, not in the consolidated. Only the remote knows if the download has been applied, so it is stored there. Here's the approach:

1) Synchronize a fresh database. This may indeed take a while, but you'll only have to do it once.

2) Copy the database to the remote somehow (See Phil's followup post)

3) Set the ml_remote_id UltraLite option to a unique value.

Your case is pretty much spelled out in the documentation. See: http://dcx.sybase.com/index.html#1201/en/uladmin/fo-dbprops-s-4074568.html*d5e11109

Former Member
0 Kudos

Russ thanks for your answer. I have many questions about this. When you say "Synchronize a fresh database" it has to be done using sybase central? Actually the ultralite database is a embedded resource in the mobile app, so, after the sync is performed, I think the database has to be replaced, so when the app is installed in the pda's(there are many) is going to be any trouble with the ml_remote_id?

philippefbertrand
Participant

Frequently you may find that downloading a pre-populated database using the ML file transfer facility is much faster than doing a large initial sync (because of index building, etc).

This initial database can be built on the fly, or you could have a task do a nightly/weekly/monthly build of one which all new clients share.

On the server that builds the initial database (using ulinit or ulload), you can use the ulsync utility to synchronize the db initially thus giving it good last download timestamps.

If a number of clients will be receiving this pre-sync'ed db, make sure you reset the ML remote id on the database (I think you can use a utility to do this or you can have the clients do it after download).

p.s. Edit your tags and change "dbmlsync" to "ultralite"