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
ADS - Lock owner and disconnecting user?
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: ADS - Lock owner and disconnecting user?
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.
-
- Posts: 4
- Joined: Tue May 24, 2016 8:30 am
Re: ADS - Lock owner and disconnecting user?
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
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
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: ADS - Lock owner and disconnecting user?
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
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
-
- Posts: 4
- Joined: Tue May 24, 2016 8:30 am
Re: ADS - Lock owner and disconnecting user?
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.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.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: ADS - Lock owner and disconnecting user?
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
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
-
- Posts: 4
- Joined: Tue May 24, 2016 8:30 am
Re: ADS - Lock owner and disconnecting user?
Cliff,
Those are pretty new versions. Did those come with 2.0 or a hotfix of 1.9???
Thanks!
Those are pretty new versions. Did those come with 2.0 or a hotfix of 1.9???
Thanks!
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: ADS - Lock owner and disconnecting user?
Not from 2.0. I got the file hotfixPDR6406.zip directly from Alaska Software. Let me know if you need it.