Lucee 7 — Request timezone isn't applied to DB connections inside parallel `.each()` workers

Hi team!

We’ve spotted a small timezone inconsistency when running queries inside parallel array iterations ( ArrayEach / .each( callback, true, n )).

While getTimeZone() inside a worker thread correctly returns the request timezone, any JDBC connection checked out on that same worker misses the override and stays on the pool/driver default timezone.

Environment

  • Lucee: 7.0.5-SNAPSHOT+41
  • Java: OpenJDK 21
  • DB: PostgreSQL 18 (pgjdbc driver)
  • Engine / OS: CommandBox (Runwar / Undertow) / Ubuntu Linux

Quick repro

<cfscript>
setTimeZone( "America/New_York" );

function sessionTZ() {
    return QueryExecute( "SHOW timezone", {}, { datasource = "yourDsn" } ).timezone;
}

echo( "getTimeZone() main: " & getTimeZone() & "<br>" ); // America/New_York
echo( "DB session main: " & sessionTZ() & "<br>" ); // America/New_York

var variables.seenTZ = [ 1, 2, 3, 4 ].map( function( i ) { return getTimeZone(); }, true, 4 );
var variables.seenDB = [ 1, 2, 3, 4 ].map( function( i ) { return sessionTZ(); }, true, 4 );

echo( "getTimeZone() workers: " & ArrayToList( variables.seenTZ ) & "<br>" ); // America/New_York x4 (OK)
echo( "DB session workers: " & ArrayToList( variables.seenDB ) & "<br>" );    // Europe/Rome x4 (BUG)
</cfscript>

Summary

Context getTimeZone() DB session (SHOW timezone)
Main thread Request TZ Request TZ :white_check_mark:
Parallel worker Request TZ Pool/driver default :x:

Impact

  1. Connection crashes: On PostgreSQL ≥ 16, if the JVM default is an abbreviation like CET, pgjdbc fails at startup with FATAL: invalid value for parameter "TimeZone": "CET". The main thread bypasses this thanks to this.timezone, but fresh connections opened by workers crash.
  2. Data drift: timestamp / timestamptz values read or written in parallel run under a different timezone than the rest of the request.

I was wondering if the Lucee team couldn’t automatically apply the PageContext timezone on connection checkout regardless of the thread, given that getTimeZone() already returns the correct value inside the worker?

Happy to share full stack traces or a test repo if needed.
Thanks for all your work on Lucee 7!

Best,
Roberto