Code
Below is the script, the queries in the thread only use the variables on the cfthread call. The process works about 80% of the time and then I receive Java.util.concurrentmodificationexception on one of the threads, occasionally more than one. Using CF 9,0,0,251028, but have tested with 9,0,2,282541 with the same issue.
Any hekp is appreciated
<cfquery name = "variables.Dts" datasource="#mydsn#">
select
to_char(next_day(to_date('#selDate#','mm/dd/yyyy')-56,'sat')+(level-1)*7-2,'mm/dd/yyyy') as thu,
to_char(next_day(to_date('#selDate#','mm/dd/yyyy')-56,'sat')+(level-1)*7-1,'mm/dd/yyyy') as fri,
to_char(next_day(to_date('#selDate#','mm/dd/yyyy')-56,'sat')+(level-1)*7,'mm/dd/yyyy') as sat
from dual
connect by level < 9
</cfquery>
<!--- test --->
<cfset qtr = 0>
<cfset tname = ''>
<cfloop query="variables.dts" >
<cfset qtr += 1>
<cfthread name="t#qtr#" action="run" sat2='#variables.dts.sat#' thu2='#variables.dts.thu#' selarea2='#selArea#' selDistrict2='#seldistrict#' qtr2='#qtr#' dsn="#mydsn#" >
<cfquery name="variables.m#qtr2#" datasource="#dsn#" >
...
</cfquery>
</cfthread>
<cfset tname &= 't#qtr#' & ','>
</cfloop>
<cfloop query="variables.dts" >
<cfset qtr += 1>
<cfthread name="t#qtr#" action="run" sat1='#variables.dts.sat#' fri1='#variables.dts.fri#' selarea1='#selArea#' selDistrict1='#seldistrict#' qtr1='#qtr#' dsn="#mydsn#">
<cfquery name="variables.m#qtr1#" datasource="#dsn#" >
...
</cfquery>
</cfthread>
<cfset tname &= 't#qtr#' & ','>
</cfloop>
<cfset tname = left(tname,len(tname)-1)>
<cfthread action="join" name="#tname#" />