on 2017 Mar 14 5:26 PM
Hello guys,
I was wondering if we could uniquely identify a sync instance in the client, so we can cross client logs with server logs somehow.
For instance, the LogML.txt file has an entry for sync ID 307962
I. 2017-03-02 07:12:54. <307962> Request from "UL 16.0.2193" for: remote ID: 1018, user name: 1109, version: MSERIES.007.037.0000
Can we get this information in the client?
If don't, can you guys suggest another way to cross our logs with yours? This would be extremely helpful for a sync issue analysis.
Request clarification before answering.
Only the remote-id (which uniquely identifies the remote database) and the timestamp can be used to correlate entries in the MobiLink Server log with information in the MobiLink Client logs. The sync ID is not generated until the synchronization reaches the MObiLink Server, and this number is never passed down to the client.
There are options if you want to go peeking into HTTP headers, but none of those values are available in either MobiLink Server nor client logs.
Reg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Reg, I appreciate your answer. I really don't mind this id be totally unique, all I want is ease the track of a sync issue from client to server. It'd be very helpful if you guys came up with a solution for this. Also, if ML server could send this sync ID info to the client, even after the sync is already started, it'd help too.
But just the synch ID is of no help if there are multiple ML Servers for the same backend system. Furthermore, the synch ID resets back to one when the ML Server is restarted, so that value isn't unique on the same ML Server either. We've always considered the timestamp and remote-id as pretty unique.
If that's not enough, you could easily implement something yourself by passing up an authentication parameter from the remote that is set to a unique GUID (or even the current timestamp at the remote) for each synchronization, and then print that information to the MobiLink log using a simple Java synchronization script (see below). Clearly, whatever value you use would also need to be put in your client side logs as well.
Reg
1) Execute the following SQL against the consolidated :
call ml_add_java_connection_script( 'v16', 'authenticate_parameters', 'Example.authParms' );
2) Create a file named Example.java with the following :
import ianywhere.ml.script.; import java.sql.; import java.util.*;public class Example {
String _remoteID; public Example( DBConnectionContext cc ) throws SQLException { _remoteID = cc.getRemoteID(); } public void authParms ( ianywhere.ml.script.InOutInteger authStatus, String user, String ap1 ) throws java.sql.SQLException { System.out.println( "=== Remote ID : " + _remoteID + " Parm : " + ap1 ); }}
3) Compile the Java Class
c:\\JDK17\\bin\\javac -classpath %SQLANY16%\\java\\mlscript.jar Example.java
4) Add the following to the ML Server start line :
-sl java(-cp c:\\path\\to\\Example.class)
Thank you very much, @Reg. This should work fine. Instead of using a Java class, I can force a warning inside the authentication script (I've tested that). However, can I access the authentication parameters inside this event?
I checked the doc and it seems I can use the parameters a.api1 in my procedure.
http://dcx.sap.com/index.html#sa160/en/mlserver/authenticate-parameters.html
If you want access to the authentication parameter in a SQL script, then you would use pass {ml a.1} into the stored procedure you have defined.
call ml_add_conenction_script( 'v16', 'authenticate_parameters', 'CALL my_auth_parm ( {ml s.authentication_status}, {ml s.remote_id}, {ml s.username}, {ml a.1} )' );
I like using Java over SQL for no other reason that the ability to write informational messages (not warnings) directly to the MobiLink Server log. The anal-rententive part of me does not like warnings that are not really warnings.
Reg
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.