=== modified file 'src/com/goldencode/p2j/persist/AdaptiveQuery.java'
--- old/src/com/goldencode/p2j/persist/AdaptiveQuery.java	2023-03-15 09:24:22 +0000
+++ new/src/com/goldencode/p2j/persist/AdaptiveQuery.java	2023-03-15 10:08:49 +0000
@@ -349,6 +349,7 @@
 **                           set is created, ProgressiveResults can no longer be the type returned.
 **     RAA 20230221          If the query will be executed lazy, then it is no longer registered as a 
 **                           listener.
+** 178 AL2 20230315          Make dynamic results "auto fetch".
 */
 
 /*
@@ -3932,6 +3933,18 @@
       {
          throw new UnsupportedOperationException();
       }
+
+      /**
+       * Is the result delegate responsible for fetching? This is usually true when using
+       * query delegates which handle the fetching process already.
+       * 
+       * @return   {@code true} for complex results which also do the fetching
+       */
+      @Override
+      public boolean isAutoFetch()
+      {
+         return true;
+      }
       
       /**
        * Get the array of objects at the current result row.

=== modified file 'src/com/goldencode/p2j/persist/PreselectQuery.java'
--- old/src/com/goldencode/p2j/persist/PreselectQuery.java	2023-03-15 09:24:22 +0000
+++ new/src/com/goldencode/p2j/persist/PreselectQuery.java	2023-03-15 10:08:30 +0000
@@ -607,6 +607,7 @@
 **                           as 'partial/incomplete'.   At this time, extent fields are always loaded.
 ** 177 CA  20230227          Fixed where clause translation when the external buffer's binding and definition
 **                           does not match.
+** 178 AL2 20230315          Avoid redundant fetch.
 */
 
 /*
@@ -5877,8 +5878,12 @@
          }
          else
          {
-            Object[] data = available ? results.get() : null;
-            coreFetch(data, lockType, errorIfNull, false);
+            boolean alreadyFetched = available && results.isAutoFetch();
+            if (!alreadyFetched)
+            {
+               Object[] data = available ? results.get() : null;
+               coreFetch(data, lockType, errorIfNull, false);
+            }
             
             if (available)
             {

=== modified file 'src/com/goldencode/p2j/persist/Results.java'
--- old/src/com/goldencode/p2j/persist/Results.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/Results.java	2023-03-15 10:08:04 +0000
@@ -2,7 +2,7 @@
 ** Module   : Results.java
 ** Abstract : Abstraction layer interface for query results
 **
-** Copyright (c) 2006-2020, Golden Code Development Corporation.
+** Copyright (c) 2006-2023, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- --JPRM-- ---------------------------Description------------------------------
 ** 001 ECF 20060214   @24711 Created initial version. Defines an API which abstracts the results
@@ -14,6 +14,7 @@
 ** 004 ECF 20190427          Fixed results caching.
 ** 005 SVL 20191002          Added addRow.
 ** 006 ECF 20200906          New ORM implementation.
+** 007 AL2 20230315          Added isAutoFetch.
 */
 
 /*
@@ -122,6 +123,17 @@
    public boolean isLast();
    
    /**
+    * Is the result delegate responsible for fetching? This is usually true when using
+    * query delegates which handle the fetching process already.
+    * 
+    * @return   {@code true} for complex results which also do the fetching.
+    */
+   default public boolean isAutoFetch() 
+   {
+      return false;
+   }
+   
+   /**
     * Get the array of objects at the current result row.
     *
     * @return  Object array or {@code null}.

=== modified file 'src/com/goldencode/p2j/persist/ResultsAdapter.java'
--- old/src/com/goldencode/p2j/persist/ResultsAdapter.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/ResultsAdapter.java	2023-03-15 10:08:10 +0000
@@ -2,7 +2,7 @@
 ** Module   : ResultsAdapter.java
 ** Abstract : Adapter object which abstracts underlying Results implementation
 **
-** Copyright (c) 2004-2020, Golden Code Development Corporation.
+** Copyright (c) 2004-2023, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- --JPRM-- ----------------------------Description-----------------------------
 ** 001 ECF 20060803   @28376 Created initial version. Adapter object which abstracts the
@@ -24,6 +24,7 @@
 **                           to true.
 ** 007 ECF 20190427          Fixed results caching.
 ** 008 ECF 20200906          New ORM implementation.
+** 009 AL2 20230315          Implemented isAutoFetch.
 */
 
 /*
@@ -81,8 +82,6 @@
 
 package com.goldencode.p2j.persist;
 
-import java.io.*;
-
 /**
  * An implementation of the {@code Results} interface which delegates all work to another {@code
  * Results} implementation.  A worker can be connected at any time using {@link #setResults}, or
@@ -203,6 +202,19 @@
    }
    
    /**
+    * Is the result delegate responsible for fetching? This is usually true when using
+    * query delegates which handle the fetching process already.
+    * 
+    * @return   {@code true} for complex results which also do the fetching.
+    * 
+    */
+   @Override
+   public boolean isAutoFetch()
+   {
+      return results.isAutoFetch();
+   }
+   
+   /**
     * Get the array of objects at the current result row.
     *
     * @return  Object array or {@code null}.

