Updating data on logout

T

T OPry

VB.Net application running on Terminal Server 2003
Middle tier is a separate DLL running on the same Terminal Server and
contains all of the ADO.Net methods which invoke stored procedures on a
separate SQL Server 2000 machine.

When the user terminates the application via menu (invokes Application.Exit)
or the close button, the Middle Tier DLL's Dispose method calls an Update
method that is used to check for any record changes and to call the
appropriate update stored procedure.

This works fine EXCEPT if the user does a 'Logout' from Terminal Server or
the session times out and the application is closed.

I have verified that the update method is being invoked and no errors are
being thrown - No errors in the event logs and I have run a trace on the
SQL server to verify that the update sProc is never being called (or at
least invoked on the client connection). However a logout stored procedure
run AFTER the update is invoked. This logout is invoked from the Main
executable, unlike the Update which is in a separate DLL.

It appears that the logout is causing the DLL with the middle tier code to
de-reference differently than when shutdown via application.exit or the
Close button.

Any ideas on the cause or possible solution?
 
T

T OPry

As a follow-up.
This same issues occurs on a regular client PC so it is not specific nor
related to Terminal Server.

Even though the method in the middle tier DLL is being invoked from the main
executable, it is never processed.
I inserted some code in-line to write messages to a text file as the methods
were processed and during logout, the method is invoked but no indication it
is processed.
 
T

T OPry

One final bit of info for anyone else that may have a similar issue-

I was using the Dispose event within the middle tier DLL to invoke an update
method that checked for changes to the dataset and if found called the
appropriate stored procedures.

This worked fine during normal user initiated application termination.
However during Windows logoff the Dispose event was fired, but the DLL was
apparently being unloaded before the Update event called within it could
complete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top