Menu

#119 Patch for connection issue related error codes

v1.2
accepted
momo
None
5
2012-08-27
2011-12-02
No

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.

Discussion

  • Anonymous

    Anonymous - 2011-12-02

    The patch

     
  • momo

    momo - 2012-08-17
    • status: open --> accepted
    • assigned_to: momo
    • milestone: --> v1.2
     
  • momo

    momo - 2012-08-17

    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

     
    • Ric Klaren

      Ric Klaren - 2012-08-24

      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

       
  • momo

    momo - 2012-08-27

    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

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.