cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Wrong value in connection_property('osuser')

Miro_Marek
Explorer
2,881

I use a program that uses impersonate to log into the SQL Anywhere database. The registration (with integrated login) works fine. The mapped user is selected. The osuser is set correctly when logging in for the first time. But this osuser remains the same for the following logins with different integrated users. The AppInfo also has this old user. Can it be cached somehow? Or is the a possibility to get the originating user for integrated login (login mappings)?

Let me be a bit more precise on what our program is doing:

  • List item
  • A thread is started in the Local System user context
  • When a "piece of work" arrives from "User1"
  • The thread impersonates as "User1" and opens a database connection using integrated login. This works well.
  • After the piece of work is done the thread reverts back to Local System
  • A second piece of work arrives from "User 2"
  • The thread impersonates as "User2"
  • Since the users are different, the program does not re-use the existing connection but opens a new database connection, once more with integrated login.
  • The database connection is opened, User2 is mapped to the correct database user (which is different from the one User 1 is mapped to), but connection_property('osuser') returns "User 1".

Accepted Solutions (0)

Answers (0)