websolete
03/28/2022, 1:23 PMthisOldDave
03/28/2022, 2:39 PMwebsolete
03/28/2022, 2:47 PMwebsolete
03/28/2022, 2:47 PMthisOldDave
03/28/2022, 2:51 PMwebsolete
03/28/2022, 2:52 PMcwigginton
03/28/2022, 3:05 PMAdam Cameron
if you can explicitly throw an error of type Database and specify a particular sql error code? i need to be able to force the same type of error getting thrown in order to come up with some handling for itIf you know the specifics of the exception, how come you need to actually explicitly throw it to be able to "come up with some handling for it"?
websolete
03/28/2022, 3:55 PMwebsolete
03/28/2022, 3:57 PMwebsolete
03/28/2022, 4:01 PMAdam Cameron
Adam Cameron
Adam Cameron
// RetryDecorator.cfc
component implements=SameInterfaceAsOriginalObject { // so it can be a drop-in replacement
function init(originalObject) {
variables.originalObject = arguments.originalObject
}
function originalMethod(same, method, signature) {
try {
return variables.originalObject.originalMethod(argumentCollection=arguments)
} catch (database e) {
if (possibly more conditional logic to identify the deadlock) {
sleep(a while)
return variables.originalObject.originalMethod(argumentCollection=arguments)
}
rethrow
}
}
}
websolete
03/28/2022, 5:29 PMAdam Cameron
<cfquery>
calls in a .cfm file??Adam Cameron
websolete
03/28/2022, 5:57 PM