4 Replies Latest reply on Oct 26, 2007 10:33 AM by paross1

    Database Link down crashing server

    TNMellowMan
      I have a problem with my server getting a JRun error and stopping Coldfusion entirely if a linked database becomes unavailable. My database will still be available and as long as nothing in the application hits the linked database, my system is fine. After several hits to the linked database, the Coldfusion server dies and never logs any error. All of the queries are in cftry/cfcatch blocks. I am assuming that the database connection is timing out because of the linked database being unavailable.

      Is there any other way to catch these errors so I can error out without dropping the whole system?
      Web Server:
      CF MX 6.1 updater 2 with database update patches
      Windows Server 2003
      IIS 6.0
      Database Server:
      Oracle 9.4.0.4
      Windows Server 2003

      Thanks
        • 1. Re: Database Link down crashing server
          paross1 Level 2
          Although you said that you are using cftry/cfcatch blocks, you didn't specify if you were actually using cfcatch type = "database". If not, then you should specifically capture database errors, but if you are and it is still crashing your server then I don't know what to recommend.

          Phil
          • 2. Re: Database Link down crashing server
            dacf Level 1
            No solutions, only some thoughts, sorry...

            (are you sure you have the _latest_ database updates? really is pretty essential - http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=988... but anyway...)

            Assuming that you mean that the linked database is done within Oracle, so I would see this as a Network/Oracle problem really.

            Best bet would be to set up a two simple databases, link to one, set datasource to one that contains the link and carry out some simple tests.

            Try what paross1 said in a simple controlled environment and then if it still breaks, then break it and take a stack dump of what is going on in the coldfusion server at the time http://www.adobe.com/go/tn_18339

            Bring back what you can and then it might be possible for the community to help.
            • 3. Re: Database Link down crashing server
              TNMellowMan Level 1
              Thanks for the responses.

              My queries do use type="Database" in the cfcatch blocks, but I will go back through to see if I have missed any.

              The links are done on the Oracle server. I can't really set up a separate datasource to that server directly as I do too many joint queries between my database and the linked one. Since the database itself has never gone down and I only get an error when the linked database is hit, I am assuming it is something to do with the way Java is accessing the database. I will also see if there is a way to error-out in a more friendly fashion from the database side.

              I will do some testing on another server and see what happens. I never seem to get any error from Coldfusion, just a generic JRun error. I have not been able to find any errors in JRun that make any sense, but I will look there again in my testing.

              Thanks again
              • 4. Re: Database Link down crashing server
                paross1 Level 2
                Have you tried to put your queries that select data from tables that are in linked databases into PL/SQL stored procedures? I would imagine that if the linked database were to become unavailable, your PL/SQL package/procedure would go invalid and that should trigger a database error that cfcatch would detect. Might be worth a try if this is a cronic problem.

                Phil