Page 1 of 1

ADS - Lock owner and disconnecting user?

Posted: Tue May 24, 2016 8:41 am
by JIM_GRAHAM
I run my xBase++ application as a "published application" in Terminal Services. If my application crashes (it happens sometimes), or the user gets disconnected from the Terminal Server, there are record locks left over that do not get cleared until the ADS Server times out the connection. This can be a problem if another user is trying to access one of the records that is currently locked. I have been trying to use the sample code from:
\Alaska\DBEW32\SOURCE\SAMPLES\ADSDBE\CONSOLE to write a function that will allow me to identify and disconnect the user that has the record(s) locked and clear them.

I can do this using the current Data Architect in ADS 11 so I know it is possible.

You need to disconnect the OS Login and ~not~ the Terminal Server login or you will disconnect all of the users on the Terminal Server.

Has anyone got any sample code that they can share that will accomplish this?

TIA

Jim

Re: ADS - Lock owner and disconnecting user?

Posted: Tue May 24, 2016 8:55 am
by Cliff Wiernik
Are you having issues with getting the user's login name/IP address. This is information I have when a lock is held by a user. fcasoftware is the RDP login name and the IP address is the address of my local workstation connecting to the remote server.
jgraham.jpg
jgraham.jpg (11.3 KiB) Viewed 21521 times

Re: ADS - Lock owner and disconnecting user?

Posted: Tue May 24, 2016 9:42 am
by JIM_GRAHAM
Cliff,

I am looking to get the work station that currently has the lock, and then use that information to disconnect that user and clear the lock(s).

Are you using the information in the screen shot to disconnect the user?

Jim

Re: ADS - Lock owner and disconnecting user?

Posted: Tue May 24, 2016 11:41 am
by Cliff Wiernik
Jim,

At this time, we are using this information to get the lock owner's name. We used a variety of OS's, netware, OES and Windows and sometimes we returned the computer name or connection number. With more recent changes (for 1.9 we needed a fix to the adsmsg.dll in order to support the additional data fields available from ADS client layer, which appears to also work for Xbase++ 2.0), we now are returning the user's login ID and IP Address or local workstation IP address.

We do not use it to terminate the user at this point, it is only information so the user can contact the individual if needed to get out of the computer.

Cliff

Re: ADS - Lock owner and disconnecting user?

Posted: Tue May 24, 2016 11:56 am
by JIM_GRAHAM
With more recent changes (for 1.9 we needed a fix to the adsmsg.dll in order to support the additional data fields available from ADS client layer, which appears to also work for Xbase++ 2.0), we now are returning the user's login ID and IP Address or local workstation IP address.
What is the version / date & timestamp on that DLL? The one I have here is 4/27/2006 @ 1:18 There is no version number in it.

Re: ADS - Lock owner and disconnecting user?

Posted: Wed May 25, 2016 8:19 am
by Cliff Wiernik
This is the ads... items I am using.

04/03/2013 01:40 PM 151,552 adsdbe.dll
12/13/2011 04:15 PM 32,768 adsmg.dll
10/13/2011 03:18 PM 34,304 AdsUtil.dll

Re: ADS - Lock owner and disconnecting user?

Posted: Wed May 25, 2016 8:36 am
by JIM_GRAHAM
Cliff,

Those are pretty new versions. Did those come with 2.0 or a hotfix of 1.9???

Thanks!

Re: ADS - Lock owner and disconnecting user?

Posted: Wed May 25, 2016 11:43 am
by Cliff Wiernik
Not from 2.0. I got the file hotfixPDR6406.zip directly from Alaska Software. Let me know if you need it.