According to the docs, CURRENT REMOTE USER is used only in SQLREMOTE.

Doesn't this work in MOBILINK too (at least by DBMLSYNC)?

Is there any other alternative for DBMLSRV too?

Sorry, I couldnt have time to try it, and just wanted to have a quick answer from the Gurus!

asked 12 Mar, 12:12

Sako's gravatar image

Sako
851354878
accept rate: 27%


CURRENT REMOTE USER is specific to SQL Remote only.

In the ML Server, you can use the {ml s.remote_id} or {ml s.username} system parameter in your synchronization scripts.

Doc Links :

For dbmlsync, you have access to the MobiLink User that is synchronizing in many of the Event hooks for SQL Anywhere clients.

Reg

permanent link

answered 12 Mar, 12:56

Reg%20Domaratzki's gravatar image

Reg Domaratzki
6.6k337101
accept rate: 40%

1

Additionally, you may use a particular database user when connecting via mlsrv to the consolidated to distinguish that from regular connections to the consolidated. This will do if you just have to distinguish remote and local modifications, it obviously won't do if you need to distinguish between modifications by different remote databases. In my experience the CURRENT REMOTE USER is used for both cases in SQL Remote environments...

(12 Mar, 17:31) Volker Barth
Replies hidden

If we are talking only of SQLRemote, then CURRENT REMOTE USER is useful (not replacable) only on the Cons. (becuase it can tell me whether the transaction is local or remote, and additionaly, it tells me from which specific Remote is this transaction coming).

On the Remote side, (if I assign a particular user for DBREMOTE), then I am able to distinguish whether the current transaction is local or is received via DBREMOTE (i.e. from the Cons. DB), (so assigning a user for DBREMOTE can replace the job of CURRENT REMOTE USER)!

In my understanding I can have only one Cons. in SQL-Remote installation! Am I right?

Also in Mobilink installation, I can have only one single Cons. (i.e. only one Mobilink server to each Mobilink Client)! Am I right?

(13 Mar, 05:10) Sako
1

As to the only one consolidated database, yes, that's generally true for each remote. However, there are environments with more than two levels/tiers, so a SQL Remote condolidated can itself be a remote for a higher level consolidated. But even then each single remote has just one (direct) consolidated.

We have also used CURRENT REMOTE USER on the remote to distinguish between local and remote operations (the latter of course then coming from the consolidated) - in my experience it was often enough to use something like "IF CURRENT REMOTE USER IS [NOT] NULL" within trigger code, and for that it only matters whether operations come from a remote or not, not from which remote. Therefore my suggestion that within ML, you simply may use a different userid for the ML server connection if that is enough.

(13 Mar, 07:24) Volker Barth
1

OK, thank you very much.

We already have several (multi tier) installations with Mobilink and also with SQLRemote.

Everything is clear!

Have a nice (and healthy) weekend!

(13 Mar, 08:11) Sako
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:

×337
×93

question asked: 12 Mar, 12:12

question was seen: 55 times

last updated: 13 Mar, 08:11