=== modified file 'src/com/goldencode/p2j/persist/FQLPreprocessor.java'
--- old/src/com/goldencode/p2j/persist/FQLPreprocessor.java	2026-10-06 07:00:00 +0000
+++ new/src/com/goldencode/p2j/persist/FQLPreprocessor.java	2026-10-07 08:00:38 +0000
@@ -775,6 +778,12 @@
     */
    private boolean inlinedTernary = false;
    
+   /**
+    * Flag indicating if an unbracketed BEGINS built its re-check from the value of a parameter
+    * pattern, thus caching by the where clause alone will not be possible.
+    */
+   private boolean inlinedBegins = false;
+   
    /** Mapping of index positions for substitution parameters after rewrite */
    private ParameterIndices paramIndices = null;
    
@@ -2033,7 +2042,7 @@
     */
    boolean wasInlined()
    {
-      return inline || inlinedTernary;
+      return inline || inlinedTernary || inlinedBegins;
    }
    
    /**
@@ -3707,6 +3716,13 @@
 
          if (prefix == null)
          {
+            // the re-check depends on the exact text of a parameter pattern
+            HQLAst literal = patternLiteral(pattern);
+            if (literal != null && literal.getType() == SUBST)
+            {
+               inlinedBegins = true;
+            }
+            
             // unbracketed, the LIKE still needs the re-check's match on the trimmed prefix
             HQLAst trimmed = trimmedPrefix(pattern, value);
 

