Vintic
July 7, 2020, 11:27am
#1
What does “alwaysSetTimeout” option? why it is not documented? It is not suggested to use it? If it always set timeout for cfquery, what is the number?
I believe it defaults to the remaining time allowed for the current request (before it times out)
if (StringUtil.isEmpty(obj)) {
boolean isCFML = pageContext.getRequestDialect() == CFMLEngine.DIALECT_CFML;
throw new ApplicationException("attribute [datasource] is required when attribute [dbtype] is not [query] and no default datasource is defined",
"you can define a default datasource as attribute [defaultdatasource] of the tag "
+ (isCFML ? Constants.CFML_APPLICATION_TAG_NAME : Constants.LUCEE_APPLICATION_TAG_NAME) + " or as data member of the "
+ (isCFML ? Constants.CFML_APPLICATION_EVENT_HANDLER : Constants.LUCEE_APPLICATION_EVENT_HANDLER) + " (this.defaultdatasource=\"mydatasource\";)");
}
data.datasource = obj instanceof DataSource ? (DataSource) obj : pageContext.getDataSource(Caster.toString(obj));
}
// timeout
if (data.datasource instanceof DataSourceImpl && ((DataSourceImpl) data.datasource).getAlwaysSetTimeout()) {
TimeSpan remaining = PageContextUtil.remainingTime(pageContext, true);
if (data.timeout == null || ((int) data.timeout.getSeconds()) <= 0 || data.timeout.getSeconds() > remaining.getSeconds()) { // not set
data.timeout = remaining;
}
}
// timezone
if (data.timezone != null || (data.datasource != null && (data.timezone = data.datasource.getTimeZone()) != null)) {
data.tmpTZ = pageContext.getTimeZone();
pageContext.setTimeZone(data.timezone);