ADS - Lock owner and disconnecting user?

This forum is for general support of Xbase++
Post Reply
Message
Author
JIM_GRAHAM
Posts: 4
Joined: Tue May 24, 2016 8:30 am

ADS - Lock owner and disconnecting user?

#1 Post 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

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: ADS - Lock owner and disconnecting user?

#2 Post 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 21446 times

JIM_GRAHAM
Posts: 4
Joined: Tue May 24, 2016 8:30 am

Re: ADS - Lock owner and disconnecting user?

#3 Post 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

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: ADS - Lock owner and disconnecting user?

#4 Post 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

JIM_GRAHAM
Posts: 4
Joined: Tue May 24, 2016 8:30 am

Re: ADS - Lock owner and disconnecting user?

#5 Post 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.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: ADS - Lock owner and disconnecting user?

#6 Post 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

JIM_GRAHAM
Posts: 4
Joined: Tue May 24, 2016 8:30 am

Re: ADS - Lock owner and disconnecting user?

#7 Post by JIM_GRAHAM »

Cliff,

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

Thanks!

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: ADS - Lock owner and disconnecting user?

#8 Post by Cliff Wiernik »

Not from 2.0. I got the file hotfixPDR6406.zip directly from Alaska Software. Let me know if you need it.

Post Reply