The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

Hello everybody,

I know that the user (or remote DB) registration process can be controlled by the administrator, by the -zu parameter, or custom scripts. When I use the code below to play with ML, my client database is always destroyed:

ConfigNonPersistent config = DatabaseManager.createConfigurationNonPersistent("testDB.ulj");

But, after some time I found out that ml_database has a plenty of "remote IDs" (remote databases that do not exist anymore). I tried to search for any API method of UltraLiteJ to unregister my database, but could not find anything.

Could you please help me with this question? Or there is not such concept in MobiLink as "register"/"unregister", and everything should be maintained by the administrator and e.g. ml_delete_remote_id/ml_delete_sync_state. I know that my example is very artificial, but I use it as the playground, and I want to do the automatic registration and unsubscription of the application from the code.

Thank you in advance,

asked 31 Jul '14, 03:41

Vlad's gravatar image

accept rate: 0%

edited 31 Jul '14, 03:55

Hi Vlad,

What you're looking at is the tracking mechanism used within MobiLink to keep track of unique remotes in the MobiLink system. It's not really a 'register'/'unregister' mechanism since remotes are generated without a remote ID by default. Unless the ml_remote_id database option is set before the first synchronization, MobiLink will generate a new remote ID for each newly initialized database and set it in the remote database once it first synchronizes.

What you really want to do is set up your register/unregister mechanism to register a MobiLink user for user authentication to the MobiLink server and then manage that authentication mechanism.

If you want to remove the unused remote IDs on the consolidated server, then yes, you will have to use 'ml_delete_sync_state'.

permanent link

answered 01 Aug '14, 10:10

Jeff%20Albion's gravatar image

Jeff Albion
accept rate: 24%

Hello Jeff,

Thank you for the answer. I know what you mentioned. The idea that I see is to create some fake remote table with the "upload_only" attribute. When the user sets a field meaning that he wants to unregister, the MobiLink server during the synchronization will invoke the stored procedure ml_delete_sync_state, instead of upserting the record.

This approach looks clumsy probably, but it is the only possible way to automate the process. RemoteID and UserName can be taken from the connection without asking the device.

What do you think about this "workaround"/"solution"?

Kind regards,

(01 Aug '14, 10:46) Vlad
Replies hidden

You can certainly do this if this is the goal you're trying to acheive to only see 'active' remote database IDs.

Personally, I would try to avoid confusing the idea of 'registering a remote ID' (which happens for any remote that can attempt to synchronize against the MobiLink server) vs. 'logging in with a authenticated MobiLink user' (which only happens for approved users by an administrator/script).

If I was using MobiLink usernames to keep track of active remotes, I could instead look at my (registered) MobiLink user information (ml_user), rather than at the remote ID information (ml_database).

(01 Aug '14, 15:19) Jeff Albion

I understand that the remote id is a bad idea to track whether the current remote database is allowed to retrieve the data, or not. I just couldn't decide if I should really clean all unused remote databases from the ml_database, when I definitely sure that this remote id will not appear again during the sync. E.g. The user has decided to do the device reset, or uninstalled the application from one of devices being used, or as in my sample project, where the non-persistent DB is used. If I have an option to unregister the user by his name, then I have a chance that all valid remote DBs will lose their sync states.

(01 Aug '14, 16:43) Vlad
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 31 Jul '14, 03:41

question was seen: 572 times

last updated: 01 Aug '14, 16:43