Patch for connection issue related error codes
Brought to you by:
ickzon
Background in this post:
https://sourceforge.net/projects/jtds/forums/forum/104388/topic/3777651
The patch is against jtds 1.2.5.
It fixes a number of SQL state return codes so connection pools like jolbox are better able to detect connection issues. The patch probably requires some review since I'm not very familiar with the jtds code. The patch could be cleaned up a little by defining some constants for the SQL state, this might make things also a bit more maintainable and easier to navigate.
This patch has run in production for about a year without issues.
Anonymous
The patch
Hi Ric,
thanks for providing that patch. I had a look at the proposed changes and while I agree that some error codes aren't correct in jTDS, some of them don't seem to be correct either (according to some documents available freely in the net). Do you have access to the official XOPEN or SQL:2003 standards or which state codes do you refer to?
Cheers,
momo
Hi,
I don't have access to the official docs, at the time I looked at various return code/SQLState documentation on the net. As mentioned the patch fixed our production issues, but I wouldn't dare vouch for 100% correctness. I could have a look at the patch again, but I would have to completely dig into the issue again. I also switched jobs so I'm actually not using jtds anymore (and have no direct guinea pig project to test things on anymore).
I could have a look but I doubt the patch will improve much, if you can point me to better specs and give some review comments on the spots were you think other codes are more approriate, I could have a stab at it.
Cheers,
Ric
Hi Ric,
thanks for clarification! I'll have a deeper look into that matter myself and apply the changes I think are correct. I'll exclude the few remaining things for the time being, at least until I find more complete (or get access to the official) specs. So there is no need to waste your time ;-)
That said, thanks again for reporting the issue and providing a patch!
Cheers,
momo