(Newsgroup folks: Sorry about the repeated post.)
I'm having a very intermittent MSSQL connection problem when using
OLEDB connections:
OLEDB Error Code = 18456
Login failed for user 'myLogin'
The only recommendation I have been given on CFTALK is to disable
"maintain db connections" in the administrator. This *may* have
helped, but it is hard to say, as the error is still occurring. (I
have looped queries tens of thousands of times to try to duplicate the
problem, but it's just too intermittent to reproduce.)
This problem is extremely troublesome, as it prevents some survey
respondents' DB insertions, and suppresses the catching of their
generated SQL statement.
What are your collective thoughts on creating some sort of nested or
looped cftry routine to re-attempt the query several times?
<!--- initialize vars --->
<cfset doLoop = 1>
<cfset i = 1>
<!--- loop over query up to 3 times, if unsuccessful --->
<cfloop condition="doLoop IS 1 AND i LTE 3">
<!--- this will stop the loop, unless there is an error --->
<cfset doLoop = 0>
<cftry>
<cfquery...>
UPDATE ...
</cfquery>
<cfcatch type="Database">
<!--- error occured, iterate loop --->
<cfset doLoop = 1>
<!--- is this the correct usage of cfrethrow??? --->
<cfif i IS 3>
<cfrethrow>
</cfif>
</cfcatch>
</cftry>
<cfset i = i+1>
</cfloop>
Thanks very much,
Jamie
_
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists