Howdy, If someone have any suggestions, even along the lines "Where did you > learn to code like this?! This is how it is done:..."
What you are doing is definitely ok, but I wonder what you are gaining out of checking specifically for the db, especially since the error msg to the user is relatively generic: "This application encountered an error (no database)...." Why not just use the global onerror() to handle issues like this and more. You can still display your msg and log all the details. The only time I use more granular error handling is if I need to communicate something special to the client, or handle the error in a special way. Just some thoughts. I'm not sure about your second issue (I'm not a BD expert), but have you looked at cflib.org for a possible solution? Cheers, Baz On Wed, Apr 22, 2009 at 7:59 AM, Alex Peshansky <[email protected]>wrote: > > Hi, > I ran into a couple of compatibility issues that I hope someone can > shed a light on. > 1. CFCATCH object seems to be lacking properties I rely upon. I use a > following construct to test for the database availability in > Application.cfc: > > <cffunction name="onApplicationStart"> > <cfset This.datasource="mydtsrce"> > <cftry><!--- Test whether the DB that this application uses is > accessible by selecting some data. ---> > <cfquery name="testDB" dataSource="#This.datasource#"> > SELECT * FROM users > </cfquery> > <!--- If we get database error, report it to the user, log the > error information, and do not start the application. ---> > <cfcatch type="database"> > <cfoutput> > This application encountered an error (no database).<br> > Please contact Alexandre Peshansky at 2-4897 or <a > href="mailto:[email protected]">via email</a>. > </cfoutput> > <cflog file="#This.Name#" type="error" text="#This.datasource# > DB not available. message: #cfcatch.message# Detail: #cfcatch.detail# > Native Error: #cfcatch.NativeErrorCode#"> > <cfreturn False> > </cfcatch> > </cftry> > </cffunction> > > Under ColdFusion if, for instance, the datasource is not defined, the > log says: > > "Error","web-7","04/22/09","10:12:25","IRBAPP","mydtsrce DB not > available. message: Data source mydtsrce could not be found. Detail: > Native Error: 0" > > Under OpenBlueDragon I am getting > CFML Runtime Error: > cfcatch.NativeErrorCode doesn't exist. > > I did not find it mentioned anywhere. > If someone have any suggestions, even along the lines "Where did you > learn to code like this?! This is how it is done:..." I'll be > grateful. > > 2. Another (documented) incompatibility I ran afoul of is missing > algorithm CFMX_COMPAT in Encrypt/Decrypt. I need a simple encryption/ > decryption with user-supplied character key as part of a simple key- > management mechanism I designed and use extensively. I also need it > to be compatible across application servers, so using BD_DEFAULT is > not an option. > If someone knows of CF implementation of CFMX_COMPAT encryption or has > other suggestions, again, I'll appreciate it. > If anyone is interested in the method, drop me a note - I have a > description written. > > Finally, is there a comprehensive compatibility test for > OpenBlueDragon, or will these gotcha!'s pop up as surprises? > > > > --~--~---------~--~----~------------~-------~--~----~ Open BlueDragon Public Mailing List http://groups.google.com/group/openbd?hl=en official site @ http://www.openbluedragon.org/ !! save a network - trim replies before posting !! -~----------~----~----~----~------~----~------~--~---
