milesibastos / jTDS

jTDS JDBC Driver
http://jtds.sourceforge.net/
GNU Lesser General Public License v2.1
81 stars 46 forks source link

processId is set to 123 when it should be the real process id #7

Open abma opened 7 years ago

abma commented 7 years ago

jTDS seems to report the wrong process id to the mssql server when connecting via tcp/ip. It seems to always report "123" when it should report the real process id.

not sure how to solve, a quick search leads to

http://stackoverflow.com/questions/35842/how-can-a-java-program-get-its-own-process-id

to reproduce, let jTDS connect to mssql and then use this query:

SELECT hostprocess FROM sys.sysprocesses WHERE dbid > 0 hostprocess='123'

derjust commented 6 years ago

This happens because of the hard coded value here used here