Using your Resources

This morning I strolled in and brought up the usual programs, started opening this very blog, and in fact was starting to write something.  Then Mick arrived, saying there was an issue.  ColdFusion was throwing an “unable to create new native thread” error on every page.  Basically, these means that the Java stack is in trouble, probably caused by long running queries that time out and hang the threads.  Now we’ve been having some issues with two sites that are still using MS Access databases for the production environment.  Not good. I know.  Given the circumstances, we do not have the time to fix the problem (but of course we have to take the time when it’s affecting all of our clients).    Anyway, so the culprit is either the MS Access queries, or a long running query in a new application that is just short of launch.  In either case, the usual Google searches for answers came up with a few results, one of which was a hotfix I didn’t know existed.  So I applied the hotfix and used my batch restart (net stop and start on the 3 big CF services) program to restart ColdFusion.  And of course there was a problem.  The “ColdFusion MX 7 ODBC Server” did not shut down, and thus did not restart.  Nuts.  Ok, so in a panic, I go check clients using databases.  They appear to be ok, except for the MS Access ones, which are now getting the following error: [Macromedia][SequeLink JDBC Driver]Internal network error, connection closed. But they weren’t working anyway due to the constantly locked up ODBC connection, so not a big deal.Ok, so far so good—relatively.  Now here’s the fun part.  I once again Googled for this, finding just a few people who have this issue, but no solution.  So, what do I do?  Well, normally, I force the process closed.  But what process is this?  This is where my handy dandy MS resource kit comes in handy.  All windows server people should have this, and I’m sure most do, but we’re a little slow on the uptake at times, being that we’re just programmers.  Within the “Windows Server 2003 Resource Kit Tools” there is a nifty little function ‘sc’ which can tell you all about the service that you need info on.  So I ran the following:C:\Program Files (x86)\Windows Resource Kits\Tools>sc queryex “ColdFusion MX 7 ODBC Server”This resulted in a little bit of output:SERVICE_NAME: ColdFusion MX 7 ODBC Server
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 3  STOP_PENDING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0×0)
        SERVICE_EXIT_CODE  : 0  (0×0)
        CHECKPOINT         : 0×0
        WAIT_HINT          : 0×0
        PID                : 13272
        FLAGS              :
Ok, so once again we find out the service is stuck in the stop state.   We find out that we can start and stop it (thank you captain obvious).  But now at least we know the Process ID (PID).  So I was curious as to what the process was….. and I found it in the task manager (under the PID of course) – it is swsoc.exe – which when Googled showed the DataDirect SequeLink Server for ODBC Socket.  Bingo.  Now the question is, do I kill this and hope that it can then be restarted without tons of angry clients?  Do I take the risk on a live production server?  Well, normally I would schedule this sort of thing for an end of the day thing when our B2B clients are not using their sites, but I took my chances.  I ran “taskkill /pid 13272 /F” at the command line and it killed it.  I then could successfully start the ODBC server (with net start).  Hooray!So now with my heart no longer pounding in my throat and chest, I can relax knowing I actually fixed something I didn’t think I could without having to reboot the entire server.  This of course also unlocked the MS Access tables, so now everyone is happy.  Well sort of, it’s now 10 AM and I haven’t done any programming yet….