We are using SQL Anywhere 16 and develop an application with MobiLink, in which ever user should be allowed to use only one device (the users have to pay for the use of the app). If the user is triggering the sync from a second device, it should fail.

Is there a out-of-the-box solution for this scenario in SQL Anywhere/MobiLink or is this something we have to develop?

Thanks and best regards, Alex

asked 05 Sep '14, 03:13

Alexander%20Ilg's gravatar image

Alexander Ilg
13181016
accept rate: 0%


Maybe the custom user authentication is what Alexander needs? http://dcx.sybase.com/index.html#sa160/en/mlstart/mt-authentication.html E.g. there it is possible to check a custom table whether the user has the remote database registered. I would use one of mobilink connection events to update that table and assign the remote ID if it was previously empty.

permanent link

answered 06 Sep '14, 03:25

Vlad's gravatar image

Vlad
3367924
accept rate: 0%

Thank you Vlad, that is what I was looking for! Now it will be easy to do all required checks within the Java code.

Best regards, Alex

(08 Sep '14, 03:03) Alexander Ilg

Short answer: There is no solution built in to SQL Anywhere/MobiLink.

Long answer: It is a simple requirement, but it is one that has spawned an entire industry: "How do I uniquely identify the computer on which my application is running?" Try asking that question on Google; I get 30,400,000 hits.

There are a lot of simplistic solutions (MAC address is a favorite) but they immediately lead to followup questions: "How do I let users move the application to a different computer when the first one is stolen/lost/destroyed/upgraded?" and "How do I deal with spoofed MAC addresses?"

There are no known solutions that meet all of these criteria: economical to implement, reliable, and user-friendly... many solutions (e.g., the one used to protect Sybase software like PowerBuilder) fail to meet ANY of those criteria... IMO anyway :)

The solution I prefer ("Rely on the honesty of users") is known to meet two of the three criteria (economical, user-friendly)... whether it meets the third criteria (reliable) is something I prefer not to think about :)

alt text

permanent link

answered 05 Sep '14, 08:20

Breck%20Carter's gravatar image

Breck Carter
27.0k424582830
accept rate: 21%

edited 05 Sep '14, 08:30

@Alexander: That being said (and I highly appreciate Breck's solution!), I'd like to ask some questiosn:

  • How would you identify an user within your application?
  • Do you use database users, MobiLink user names or the like?
  • Do your users get an "empty" database or is it somehow pre-registered (say, with a particular remote_id)?
  • Are your users allowed to move the app between devices (or at least to "unregister" for an old device and to "re-register" for a new one)?
(05 Sep '14, 11:04) Volker Barth
Replies hidden
Comment Text Removed

Volker, see my comments below ...

How would you identify an user within your application?

  • The user goes on an existing website and creates a new "mobile device" aka mobile user.
  • We give him a username and password and at the same time make a call to the SQL Anywhere server, creating a new entry in the ml_users table
  • The user logs into the app on his iPad/Android/Win 8.1 tablet and we start the MobiLink sync with these credentials.

Do you use database users, MobiLink user names or the like?

We use the MobiLink user for the authentication on the mobile device.

Do your users get an "empty" database or is it somehow pre-registered (say, with a particular remote_id)?

We deploy an empty UltraLite db with the app

Are your users allowed to move the app between devices (or at least to "unregister" for an old device and to "re-register" for a new one)?

Yes, this is possible. For this, they go to the website, delete the old mobile device/user and create a new one.

I think we have everything in place, what we really would need is "something" when the initial synchronization happens. Then we need to see if the user (aka mobile device) already requested data before. If that is the case, we would return an error message.

I have an idea how this could be done via a small Java program, I just wonder if I really need to do this or if there is a standard functionality that enables this.

(05 Sep '14, 12:10) Alexander Ilg
Comment Text Removed

Then we need to see if the user (aka mobile device) already requested data before.

Please define "already requested data before". Remote databases upload and download data, they don't "request" anything per se.

return an error message

Please define "return an error message". The MobiLink server processes the upload stream and sends a download stream of inserts, updates and deletes. It does not have a client-server relationship with the remote user, so there is nowhere for it to display anything.

In other words, there is nothing built in to do what you want to do... assuming I understand what you want to do, which I might not :)

(05 Sep '14, 14:00) Breck Carter
1

If the ML user name is used as "unique user ID" and the database is initially without a remote ID (as you say, it's delivered "empty"), you might choose to use that name as the remote ID, too, as described here.

I guess then you could verify that

a) either the remote id has not yet sync'ed (it has been empty before) b) or it's internal progress state does match the one as stored within the ML server or to compare other "identifying data" as MAC address or whatever.

I guess that can be done with the help of custom authentication (as Vlad has suggested).


Note: Just some suggestions, I have not implemented such a mechanism myself...

(07 Sep '14, 06:37) Volker Barth
Comment Text Removed
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×278
×70

question asked: 05 Sep '14, 03:13

question was seen: 615 times

last updated: 08 Sep '14, 03:41