July 14, 2004
Verify a dsn connectivity on the fly
Every once in a while, you may want to have logic to verify the data source within your code. The following trick will work.
<cfset variables.lockname = CreateUUID() />
<cflock name="#variables.lockname#" type="exclusive" timeout="10">
<cfscript>
factory = CreateObject("java", "coldfusion.server.ServiceFactory");
ds_service = factory.DataSourceService;
isOk = ds_service.verifyDatasource("#Application.dsn#");
</cfscript>
</cflock>
I was looking for such an idea in a missCrit system BUT...aren't you worried that factory is unsupported? are you really game to put this in proddy code and send it out there?
great idea but i know my boss won't go for it because of that reason. Hell, he's even saying that cfscript will go the way of the dodo...eventually.
no docs from MM = no support = no guarentees...
just 2c worth.
barry.b
Hi,
I agree whole heartily with you. Sometimes just because we can doesn't mean we should. Its a neat trick, but not something I'd deploy at work.
Really depends on the risk nature of the organization.
Elyse
Posted by: Elyse at July 23, 2004 9:23 PMFinally passed the test
Managing in light of McGregor's Theory X and Theory Y
CMMI
Kicking HIT Leadership Up a Notch
That's just some mumbo jumbo project management BS
Outcomes - The tactic to get to the strategy
Nurse Call, VOIP, and Wi-Fi: Its just cool when things come together!
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
August 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
November 2005
October 2005
September 2005
August 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
Joel on Software
David Ross
Edward Prevost
Martin Fowler
The Health Care Blog
The Tales of Hoffman
The Business Word
Medical Rants
Christina's Considerations
Paul Levy
HIS Talk
Appropriate IT
Candid CIO
RSS feed




