Home > Archive > SQL Anywhere Mobile > August 2005 > Re: Is it possible to synchronize & insert,delete, update using the mobilink client's authentic









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Is it possible to synchronize & insert,delete, update using the mobilink client's authentic
vsv

2005-08-31, 11:24 am

Reg,
thanks for your response.
I thought that is what is in stake. My client is against that change & were
evaluating mobilink for remote. That is a jeopardy then.
Sorry, I didn't mention the environment & I knew it doesn't matter.
ASE 12.5.1
We use @suser_name all over the triggers & procs.
The whole system is driven by that.

I was wondering if we have a java application server doing all the (database
transaction calls); establish a connection in the authenticate_user by
creating a session with connection to DB in the app server. Is that a
possible solution?

It will be just another layer but it will be just a pure 1 to 1 method
(java) to proc call.
This will avoid the changes in the existing system.

If the above can be done, why not when doing directly with ASE. Is this a
feature for "Jasper". I signed up for it, but didn't receive the invitation,
so if any sight on that will be nice.
thanks in advance.
vsv




"Reg Domaratzki (iAnywhere Solutions)" <FirstName.LastName@ianywhere.com>
wrote in message news:4315ae53$1@foru
ms-2-dub...
> If your triggers are currently using CURRENT USER, then the quick answer

is
> no.
>
> The longer answer involves re-writing your triggers a little. First,

assume
> you've defined the following two MobiLink events :
>
> call ml_add_connection_sc
ript ( 'v1', 'begin_connection', 'create variable
> @mlu varchar(128)' );
> call ml_add_connection_sc
ript ( 'v1', 'begin_synchronizati
on', 'set @mlu =
> ?' );
>
> Now, a trigger that used to read :
>
> create trigger bi_t1 before insert on t1
> referencing new as nr for each row
> begin
> insert into tracking_table values ( 'whatever', CURRENT USER );
> end;
>
> Would now read :
>
> create trigger bi_t1 before insert on t1
> referencing new as nr for each row
> begin
> declare @uname varchar(128);
>
> if VAREXISTS( '@mlu' ) = 1 then set @uname = @mlu;
> else set @uname = CURRENT USER;
> end if;
> insert into tracking_table values ( 'whatever', @uname );
> end;
>
> When re-written as above, the trigger will now use CURRENT USER unless the
> @mlu variable is defined (which means the connection is from MobiLink), in
> which case it will use the value of @mlu, which is the name of the user

that
> is synchronizing. If you have stored procedures that use CURRENT USER as
> well, then those would need to be modified as well.
>
> --
> Reg Domaratzki, Sybase iAnywhere Solutions
> Sybase Certified Professional - Sybase ASA Developer Version 8
> Please reply only to the newsgroup
>
> iAnywhere Developer Community : http://www.ianywhere.com/developer
> iAnywhere Documentation :

http://www.ianywhere.com/developer/product_manuals
> ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
> -> Choose SQL Anywhere Studio
> -> Set filter to "Display ALL platforms IN ALL MONTHS"
>
>
> "vsv" <nospam@nospam.com> wrote in message news:4314a8f8$1@foru
ms-1-dub...
> dbmlsrv9
all[color=darkred]
> of
> The
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com