This is an automated email from the ASF dual-hosted git repository.
asf-ci-deploy pushed a commit to branch asf-site-production
in repository https://gitbox.apache.org/repos/asf/grails-website.git
The following commit(s) were added to refs/heads/asf-site-production by this
push:
new 9248dcb5e01 Deploying to documentation branch - 13:30:51
9248dcb5e01 is described below
commit 9248dcb5e0108140a77827fd2ecc6eaf9d4c9e93
Author: jdaugherty <[email protected]>
AuthorDate: Fri Mar 13 13:30:54 2026 +0000
Deploying to documentation branch - 13:30:51
---
docs/snapshot/api/index-all.html | 7 ++-
.../testing/cleanup/core/DatabaseCleanup.html | 29 ++++++++++-
.../cleanup/core/DatabaseCleanupInterceptor.html | 27 +++++++---
.../developer-manual/gettingStarted.html | 2 +-
.../grails-data/developer-manual/introduction.html | 2 +-
.../grails-data/developer-manual/stepByStep.html | 2 +-
.../grails-data/developer-manual/testing.html | 2 +-
.../developer-manual/understandingApi.html | 2 +-
.../understandingApi/datastoreBasics.html | 2 +-
.../understandingApi/gormApis.html | 2 +-
.../understandingApi/gormEnhancer.html | 2 +-
.../understandingApi/implementingCrud.html | 2 +-
.../understandingApi/implementingQueries.html | 2 +-
.../understandingApi/secondaryIndexes.html | 2 +-
.../grails-data/whats-new-manual/index.html | 2 +-
docs/snapshot/guide/single.html | 59 ++++++++++++++++++++++
docs/snapshot/guide/testing.html | 59 ++++++++++++++++++++++
17 files changed, 185 insertions(+), 20 deletions(-)
diff --git a/docs/snapshot/api/index-all.html b/docs/snapshot/api/index-all.html
index c14946ae1aa..293e791a230 100644
--- a/docs/snapshot/api/index-all.html
+++ b/docs/snapshot/api/index-all.html
@@ -4720,6 +4720,9 @@ if (location.href.indexOf('is-external=true') == -1) {
</dt><dd> <div class="block"></div></dd>
<dt><span class="strong"><a
href="org/apache/grails/data/testing/tck/tests/WhereQueryConnectionRoutingSpec.html#cleanup()"
title="Method in WhereQueryConnectionRoutingSpec">cleanup()</a></span> -
Method in <a
href="org/apache/grails/data/testing/tck/tests/WhereQueryConnectionRoutingSpec.html">WhereQueryConnectionRoutingSpec</a>
</dt><dd> <div class="block"></div></dd>
+<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanup.html#cleanupAfterSpec()"
title="Method in DatabaseCleanup">cleanupAfterSpec()</a></span> - Method in <a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanup.html">DatabaseCleanup</a>
+</dt><dd> <div class="block">When <CODE>true</CODE>, database cleanup is
deferred until after the entire spec finishes
+ (<CODE>cleanupSpec</CODE>) instead of running after each individual test
method.</div></dd>
<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleaner.html#cleanupCacheLayer(org.springframework.context.ApplicationContext)"
title="Method in
DatabaseCleaner">cleanupCacheLayer(org.springframework.context.ApplicationContext)</a></span>
- Method in <a
href="org/apache/grails/testing/cleanup/core/DatabaseCleaner.html">DatabaseCleaner</a>
</dt><dd> <div class="block">Optional callback to evict the Hibernate
second-level cache after database cleanup.
</div></dd>
@@ -8364,7 +8367,7 @@ if (location.href.indexOf('is-external=true') == -1) {
<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html"
title="Class in
org.apache.grails.testing.cleanup.core">DatabaseCleanupInterceptor</a></span> -
Class in <a
href="./org/apache/grails/testing/cleanup/core/package-summary.html">org.apache.grails.testing.cleanup.core</a>
</dt><dd><div class="block">Spock method interceptor that performs database
cleanup after tests annotated
with <a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatabaseCleanup.html'
title='DatabaseCleanup'>DatabaseCleanup</a>. </div></dd>
-<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html#DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, org.apache.grails.testing.cleanup.core.DatasourceCleanupMapping,
org.apache.grails.testing.cleanup.core.ApplicationContextResolver)"
title="Constructor in
DatabaseCleanupInterceptor">DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, org.ap [...]
+<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html#DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, boolean,
org.apache.grails.testing.cleanup.core.DatasourceCleanupMapping,
org.apache.grails.testing.cleanup.core.ApplicationContextResolver)"
title="Constructor in
DatabaseCleanupInterceptor">DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolea [...]
</dt><dd> <div class="block">
<DL><DT><B>Parameters:</B></DT><DD><code>context</code> - the cleanup context
containing the cleaners and configuration</DD></DL></div></dd>
<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupStats.html"
title="Class in
org.apache.grails.testing.cleanup.core">DatabaseCleanupStats</a></span> - Class
in <a
href="./org/apache/grails/testing/cleanup/core/package-summary.html">org.apache.grails.testing.cleanup.core</a>
</dt><dd><div class="block">Captures statistics from a single datasource
cleanup operation, including which
@@ -25655,6 +25658,8 @@ if (location.href.indexOf('is-external=true') == -1) {
</dt><dd> <div class="block"></div></dd>
<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html#interceptCleanupMethod(org.spockframework.runtime.extension.IMethodInvocation)"
title="Method in
DatabaseCleanupInterceptor">interceptCleanupMethod(org.spockframework.runtime.extension.IMethodInvocation)</a></span>
- Method in <a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html">DatabaseCleanupInterceptor</a>
</dt><dd> <div class="block"></div></dd>
+<dt><span class="strong"><a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html#interceptCleanupSpecMethod(org.spockframework.runtime.extension.IMethodInvocation)"
title="Method in
DatabaseCleanupInterceptor">interceptCleanupSpecMethod(org.spockframework.runtime.extension.IMethodInvocation)</a></span>
- Method in <a
href="org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html">DatabaseCleanupInterceptor</a>
+</dt><dd> <div class="block"></div></dd>
<dt><span class="strong"><a href="grails/artefact/Interceptor.html"
title="Trait in grails.artefact">Interceptor</a></span> - Trait in <a
href="./grails/artefact/package-summary.html">grails.artefact</a>
</dt><dd><div class="block">An interceptor can be used to intercept requests
to controllers and URIs</div></dd>
<dt><span class="strong"><a
href="org/grails/orm/hibernate/connections/HibernateConnectionSourceFactory.html#interceptor"
title="Field in HibernateConnectionSourceFactory">interceptor</a></span> -
Field in <a
href="org/grails/orm/hibernate/connections/HibernateConnectionSourceFactory.html">HibernateConnectionSourceFactory</a>
diff --git
a/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanup.html
b/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanup.html
index 44e93f8df90..44221d50091 100644
---
a/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanup.html
+++
b/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanup.html
@@ -161,6 +161,10 @@ if (location.href.indexOf('is-external=true') == -1) {
// Use a custom ApplicationContext resolver
@DatabaseCleanup(resolver = MyCustomResolver)
class MySpec extends Specification { ... }
+
+ // Clean only once after the entire spec finishes (class-level only)
+ @DatabaseCleanup(cleanupAfterSpec = true)
+ class MySpec extends Specification { ... }
</pre></p>
</li>
@@ -202,13 +206,20 @@ if (location.href.indexOf('is-external=true') == -1) {
</tr>
<tr class="altColor">
+ <td class="colFirst"><code></code></td>
+ <td
class="colLast"><code>abstract boolean</code></td>
+ <td class="colLast"><code><strong><a
href="#cleanupAfterSpec()">cleanupAfterSpec</a></strong>()</code><br>When
<CODE>true</CODE>, database cleanup is deferred until after the entire spec
finishes
+ (<CODE>cleanupSpec</CODE>) instead of running after each individual test
method.</td>
+ </tr>
+
+ <tr class="rowColor">
<td class="colFirst"><code></code></td>
<td
class="colLast"><code>abstract java.lang.Class<? extends <a
href='../../../../../../org/apache/grails/testing/cleanup/core/ApplicationContextResolver.html'
title='ApplicationContextResolver'>ApplicationContextResolver</a>></code></td>
<td class="colLast"><code><strong><a
href="#resolver()">resolver</a></strong>()</code><br>The <a
href='../../../../../../org/apache/grails/testing/cleanup/core/ApplicationContextResolver.html'
title='ApplicationContextResolver'>ApplicationContextResolver</a>
implementation to use for resolving the
org.springframework.context.ApplicationContext from the test instance.</td>
</tr>
- <tr class="rowColor">
+ <tr class="altColor">
<td class="colFirst"><code></code></td>
<td
class="colLast"><code>abstract java.lang.String[]</code></td>
<td class="colLast"><code><strong><a
href="#value()">value</a></strong>()</code><br>The datasource entries to clean
up. </td>
@@ -264,6 +275,22 @@ if (location.href.indexOf('is-external=true') == -1) {
</a>
<h3>Method Detail</h3>
+ <a name="cleanupAfterSpec()"><!-- --></a>
+ <ul class="blockListLast">
+ <li class="blockList">
+ <h4>abstract boolean
<strong>cleanupAfterSpec</strong>()</h4>
+ <p> When <CODE>true</CODE>, database cleanup
is deferred until after the entire spec finishes
+ (<CODE>cleanupSpec</CODE>) instead of running after each individual test
method.
+
+ <p>This attribute is only valid on class-level annotations. Setting it to
<CODE>true</CODE>
+ on a method-level annotation will result in an
java.lang.IllegalStateException at
+ spec visit time.</p>
+
+ <p>This is useful for specs where test methods build on each other's data, or
where
+ per-test cleanup is too expensive and a single cleanup at the end is
sufficient.</p> <DL><DT><B>Returns:</B></DT><DD><CODE>true</CODE> to defer
cleanup until after the spec finishes; defaults to
<CODE>false</CODE></DD></DL></p>
+ </li>
+ </ul>
+
<a name="resolver()"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
diff --git
a/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html
b/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html
index a54a58ba27c..176c2ea80a3 100644
---
a/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html
+++
b/docs/snapshot/api/org/apache/grails/testing/cleanup/core/DatabaseCleanupInterceptor.html
@@ -152,7 +152,7 @@ extends <a
href='../../../../../../org.spockframework.runtime.extension.Abstract
<tr class="altColor">
<td class="colFirst">
- <code><strong><a
href="#DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, org.apache.grails.testing.cleanup.core.DatasourceCleanupMapping,
org.apache.grails.testing.cleanup.core.ApplicationContextResolver)">DatabaseCleanupInterceptor</a></strong>(<a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatabaseCleanupContext.html'>DatabaseCleanupContext</a>
context, boolean classLevelCleanup, <a hre [...]
+ <code><strong><a
href="#DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, boolean,
org.apache.grails.testing.cleanup.core.DatasourceCleanupMapping,
org.apache.grails.testing.cleanup.core.ApplicationContextResolver)">DatabaseCleanupInterceptor</a></strong>(<a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatabaseCleanupContext.html'>DatabaseCleanupContext</a>
context, boolean classLevelCleanu [...]
</tr>
</table>
@@ -183,6 +183,12 @@ extends <a
href='../../../../../../org.spockframework.runtime.extension.Abstract
</tr>
<tr class="rowColor">
+ <td class="colFirst"><code></code></td>
+ <td class="colLast"><code>void</code></td>
+ <td class="colLast"><code><strong><a
href="#interceptCleanupSpecMethod(org.spockframework.runtime.extension.IMethodInvocation)">interceptCleanupSpecMethod</a></strong>(<a
href='../../../../../../org.spockframework.runtime.extension.IMethodInvocation.html'>IMethodInvocation</a>
invocation)</code><br></td>
+ </tr>
+
+ <tr class="altColor">
<td class="colFirst"><code></code></td>
<td class="colLast"><code>void</code></td>
<td class="colLast"><code><strong><a
href="#interceptSetupMethod(org.spockframework.runtime.extension.IMethodInvocation)">interceptSetupMethod</a></strong>(<a
href='../../../../../../org.spockframework.runtime.extension.IMethodInvocation.html'>IMethodInvocation</a>
invocation)</code><br></td>
@@ -217,13 +223,14 @@ extends <a
href='../../../../../../org.spockframework.runtime.extension.Abstract
</a>
<h3>Constructor Detail</h3>
- <a
name="DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, org.apache.grails.testing.cleanup.core.DatasourceCleanupMapping,
org.apache.grails.testing.cleanup.core.ApplicationContextResolver)"><!-- --></a>
+ <a
name="DatabaseCleanupInterceptor(org.apache.grails.testing.cleanup.core.DatabaseCleanupContext,
boolean, boolean,
org.apache.grails.testing.cleanup.core.DatasourceCleanupMapping,
org.apache.grails.testing.cleanup.core.ApplicationContextResolver)"><!-- --></a>
<ul class="blockListLast">
<li class="blockList">
-
<h4><strong>DatabaseCleanupInterceptor</strong>(<a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatabaseCleanupContext.html'>DatabaseCleanupContext</a>
context, boolean classLevelCleanup, <a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatasourceCleanupMapping.html'>DatasourceCleanupMapping</a>
mapping, <a
href='../../../../../../org/apache/grails/testing/cleanup/core/ApplicationContextResolver.html'>ApplicationContextRe
[...]
-
<p><DL><DT><B>DatabaseCleanup:</B></DT><DD>@param mapping the parsed
datasource-to-type mapping from the class-level annotation;
- for method-level cleanup, the method's own annotation values are
parsed at runtime</DD></DL>
<DL><DT><B>Parameters:</B></DT><DD><code>context</code> - the cleanup context
containing the cleaners and
configuration</DD><DD><code>classLevelCleanup</code> - if true, cleanup runs
after every test method;
- if false, only after methods annotated
with</DD><DD><code>resolver</code> - the strategy for resolving the
ApplicationContext from test instances</DD></DL></p>
+
<h4><strong>DatabaseCleanupInterceptor</strong>(<a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatabaseCleanupContext.html'>DatabaseCleanupContext</a>
context, boolean classLevelCleanup, boolean cleanupAfterSpec, <a
href='../../../../../../org/apache/grails/testing/cleanup/core/DatasourceCleanupMapping.html'>DatasourceCleanupMapping</a>
mapping, <a
href='../../../../../../org/apache/grails/testing/cleanup/core/ApplicationContextResolver.
[...]
+
<p><DL><DT><B>DatabaseCleanup:</B></DT><DD>@param cleanupAfterSpec if true,
cleanup is deferred until after the entire spec
+ finishes (cleanupSpec phase) instead of after each test
method</DD></DL> <DL><DT><B>Parameters:</B></DT><DD><code>context</code> - the
cleanup context containing the cleaners and
configuration</DD><DD><code>classLevelCleanup</code> - if true, cleanup runs
after every test method;
+ if false, only after methods annotated
with</DD><DD><code>mapping</code> - the parsed datasource-to-type mapping from
the class-level annotation;
+ for method-level cleanup, the method's own annotation values are
parsed at runtime</DD><DD><code>resolver</code> - the strategy for resolving
the ApplicationContext from test instances</DD></DL></p>
</li>
</ul>
@@ -248,6 +255,14 @@ extends <a
href='../../../../../../org.spockframework.runtime.extension.Abstract
</li>
</ul>
+ <a
name="interceptCleanupSpecMethod(org.spockframework.runtime.extension.IMethodInvocation)"><!--
--></a>
+ <ul class="blockListLast">
+ <li class="blockList">
+ <h4>@java.lang.Override<br>void
<strong>interceptCleanupSpecMethod</strong>(<a
href='../../../../../../org.spockframework.runtime.extension.IMethodInvocation.html'>IMethodInvocation</a>
invocation)</h4>
+ <p></p>
+ </li>
+ </ul>
+
<a
name="interceptSetupMethod(org.spockframework.runtime.extension.IMethodInvocation)"><!--
--></a>
<ul class="blockListLast">
<li class="blockList">
diff --git a/docs/snapshot/grails-data/developer-manual/gettingStarted.html
b/docs/snapshot/grails-data/developer-manual/gettingStarted.html
index aaed393ab74..84571e9855a 100644
--- a/docs/snapshot/grails-data/developer-manual/gettingStarted.html
+++ b/docs/snapshot/grails-data/developer-manual/gettingStarted.html
@@ -523,7 +523,7 @@ cd grails-core</pre>
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git a/docs/snapshot/grails-data/developer-manual/introduction.html
b/docs/snapshot/grails-data/developer-manual/introduction.html
index 86c61c3faf1..27c1d2e5b31 100644
--- a/docs/snapshot/grails-data/developer-manual/introduction.html
+++ b/docs/snapshot/grails-data/developer-manual/introduction.html
@@ -476,7 +476,7 @@ body.book #toc,body.book #preamble,body.book
h1.sect0,body.book .sect1>h2{page-b
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git a/docs/snapshot/grails-data/developer-manual/stepByStep.html
b/docs/snapshot/grails-data/developer-manual/stepByStep.html
index b33953a16d8..4dbc93ac34d 100644
--- a/docs/snapshot/grails-data/developer-manual/stepByStep.html
+++ b/docs/snapshot/grails-data/developer-manual/stepByStep.html
@@ -621,7 +621,7 @@ class XyzTestSuite {
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git a/docs/snapshot/grails-data/developer-manual/testing.html
b/docs/snapshot/grails-data/developer-manual/testing.html
index 015f946c5fb..8f619691c59 100644
--- a/docs/snapshot/grails-data/developer-manual/testing.html
+++ b/docs/snapshot/grails-data/developer-manual/testing.html
@@ -511,7 +511,7 @@ class PagedResultSpec extends GormDatastoreSpec{
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git a/docs/snapshot/grails-data/developer-manual/understandingApi.html
b/docs/snapshot/grails-data/developer-manual/understandingApi.html
index 904237a2476..928b2aee962 100644
--- a/docs/snapshot/grails-data/developer-manual/understandingApi.html
+++ b/docs/snapshot/grails-data/developer-manual/understandingApi.html
@@ -454,7 +454,7 @@ body.book #toc,body.book #preamble,body.book
h1.sect0,body.book .sect1>h2{page-b
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git
a/docs/snapshot/grails-data/developer-manual/understandingApi/datastoreBasics.html
b/docs/snapshot/grails-data/developer-manual/understandingApi/datastoreBasics.html
index 29efdddeae3..979d5384aa7 100644
---
a/docs/snapshot/grails-data/developer-manual/understandingApi/datastoreBasics.html
+++
b/docs/snapshot/grails-data/developer-manual/understandingApi/datastoreBasics.html
@@ -561,7 +561,7 @@ protected Session createSession(PropertyResolver
connDetails) {
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git
a/docs/snapshot/grails-data/developer-manual/understandingApi/gormApis.html
b/docs/snapshot/grails-data/developer-manual/understandingApi/gormApis.html
index 0c8ce88ecfd..66bb74611f0 100644
--- a/docs/snapshot/grails-data/developer-manual/understandingApi/gormApis.html
+++ b/docs/snapshot/grails-data/developer-manual/understandingApi/gormApis.html
@@ -496,7 +496,7 @@ class Neo4jEntityTraitProvider implements
GormEntityTraitProvider {
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git
a/docs/snapshot/grails-data/developer-manual/understandingApi/gormEnhancer.html
b/docs/snapshot/grails-data/developer-manual/understandingApi/gormEnhancer.html
index 35b9dbb5642..b6e92c8304a 100644
---
a/docs/snapshot/grails-data/developer-manual/understandingApi/gormEnhancer.html
+++
b/docs/snapshot/grails-data/developer-manual/understandingApi/gormEnhancer.html
@@ -488,7 +488,7 @@ enhancer.enhance()</code></pre>
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git
a/docs/snapshot/grails-data/developer-manual/understandingApi/implementingCrud.html
b/docs/snapshot/grails-data/developer-manual/understandingApi/implementingCrud.html
index d82e15a18d0..850b419d9d8 100644
---
a/docs/snapshot/grails-data/developer-manual/understandingApi/implementingCrud.html
+++
b/docs/snapshot/grails-data/developer-manual/understandingApi/implementingCrud.html
@@ -673,7 +673,7 @@ protected void deleteEntry(String family, final Object key,
final Object entry)
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git
a/docs/snapshot/grails-data/developer-manual/understandingApi/implementingQueries.html
b/docs/snapshot/grails-data/developer-manual/understandingApi/implementingQueries.html
index c550863499a..3208044d209 100644
---
a/docs/snapshot/grails-data/developer-manual/understandingApi/implementingQueries.html
+++
b/docs/snapshot/grails-data/developer-manual/understandingApi/implementingQueries.html
@@ -588,7 +588,7 @@ If, for instance, the underlying datastore does not support
the calculation of a
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git
a/docs/snapshot/grails-data/developer-manual/understandingApi/secondaryIndexes.html
b/docs/snapshot/grails-data/developer-manual/understandingApi/secondaryIndexes.html
index 521a94bd12f..9dca548dddd 100644
---
a/docs/snapshot/grails-data/developer-manual/understandingApi/secondaryIndexes.html
+++
b/docs/snapshot/grails-data/developer-manual/understandingApi/secondaryIndexes.html
@@ -526,7 +526,7 @@ If the underlying datastore supports secondary indexes then
it is ok to just ret
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git a/docs/snapshot/grails-data/whats-new-manual/index.html
b/docs/snapshot/grails-data/whats-new-manual/index.html
index 1cb78cfaf6f..a2ccba2cc24 100644
--- a/docs/snapshot/grails-data/whats-new-manual/index.html
+++ b/docs/snapshot/grails-data/whats-new-manual/index.html
@@ -527,7 +527,7 @@ body.book #toc,body.book #preamble,body.book
h1.sect0,body.book .sect1>h2{page-b
<div id="footer">
<div id="footer-text">
Version 7.0.9-SNAPSHOT<br>
-Last updated 2026-03-13 11:51:00 UTC
+Last updated 2026-03-13 13:17:59 UTC
</div>
</div>
</body>
diff --git a/docs/snapshot/guide/single.html b/docs/snapshot/guide/single.html
index 75598361c64..b268781c76a 100644
--- a/docs/snapshot/guide/single.html
+++ b/docs/snapshot/guide/single.html
@@ -29013,6 +29013,65 @@ This has the downside that you cannot implement it
differently for different cas
<div class="paragraph">
<p>If no names are specified, all datasources in the application context are
cleaned.</p>
</div>
+</div>
+<div class="sect4">
+<h5 id="_deferred_cleanup_cleanupafterspec">Deferred Cleanup
(cleanupAfterSpec)</h5>
+<div class="paragraph">
+<p>By default, <code>@DatabaseCleanup</code> truncates tables after each
individual test method. If you prefer to defer cleanup until after the entire
spec finishes, set <code>cleanupAfterSpec = true</code>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="groovy"><span
class="annotation">@Integration</span>
+<span class="annotation">@DatabaseCleanup</span>(cleanupAfterSpec = <span
class="predefined-constant">true</span>)
+<span class="annotation">@Stepwise</span>
+<span class="type">class</span> <span class="class">SharedDataSpec</span>
<span class="directive">extends</span> Specification {
+
+ <span class="annotation">@Transactional</span>
+ <span class="type">void</span> <span class="string"><span
class="delimiter">"</span><span class="content">test 1 - create
data</span><span class="delimiter">"</span></span>() {
+ <span class="key">when</span>:
+ <span class="keyword">new</span> <span
class="predefined-type">Book</span>(<span class="key">title</span>: <span
class="string"><span class="delimiter">'</span><span class="content">Grails in
Action</span><span class="delimiter">'</span></span>).save(<span
class="key">flush</span>: <span class="predefined-constant">true</span>, <span
class="key">failOnError</span>: <span class="predefined-constant">true</span>)
+
+ <span class="key">then</span>:
+ <span class="predefined-type">Book</span>.count() == <span
class="integer">1</span>
+ }
+
+ <span class="annotation">@Transactional</span>
+ <span class="type">void</span> <span class="string"><span
class="delimiter">"</span><span class="content">test 2 - data from test 1
is still available</span><span class="delimiter">"</span></span>() {
+ <span class="key">expect</span>: <span class="string"><span
class="delimiter">'</span><span class="content">data persists across
tests</span><span class="delimiter">'</span></span>
+ <span class="predefined-type">Book</span>.count() == <span
class="integer">1</span>
+ }
+
+ <span class="comment">// Database is cleaned once after both tests
complete</span>
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>This is useful when test methods build on each other’s data, or when
per-test cleanup is too expensive and a single cleanup at the end of the spec
is sufficient.</p>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+<code>cleanupAfterSpec</code> is only valid on class-level
<code>@DatabaseCleanup</code> annotations. Using it on a method-level
annotation will throw an <code>IllegalStateException</code>.
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+If individual methods within a <code>cleanupAfterSpec = true</code> spec also
have their own <code>@DatabaseCleanup</code> annotation, those methods will
still be cleaned up immediately after execution.
+</td>
+</tr>
+</table>
+</div>
<div class="admonitionblock warning">
<table>
<tr>
diff --git a/docs/snapshot/guide/testing.html b/docs/snapshot/guide/testing.html
index 3498f056e60..da73bc684a9 100644
--- a/docs/snapshot/guide/testing.html
+++ b/docs/snapshot/guide/testing.html
@@ -2439,6 +2439,65 @@ This has the downside that you cannot implement it
differently for different cas
<div class="paragraph">
<p>If no names are specified, all datasources in the application context are
cleaned.</p>
</div>
+</div>
+<div class="sect4">
+<h5 id="_deferred_cleanup_cleanupafterspec">Deferred Cleanup
(cleanupAfterSpec)</h5>
+<div class="paragraph">
+<p>By default, <code>@DatabaseCleanup</code> truncates tables after each
individual test method. If you prefer to defer cleanup until after the entire
spec finishes, set <code>cleanupAfterSpec = true</code>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="groovy"><span
class="annotation">@Integration</span>
+<span class="annotation">@DatabaseCleanup</span>(cleanupAfterSpec = <span
class="predefined-constant">true</span>)
+<span class="annotation">@Stepwise</span>
+<span class="type">class</span> <span class="class">SharedDataSpec</span>
<span class="directive">extends</span> Specification {
+
+ <span class="annotation">@Transactional</span>
+ <span class="type">void</span> <span class="string"><span
class="delimiter">"</span><span class="content">test 1 - create
data</span><span class="delimiter">"</span></span>() {
+ <span class="key">when</span>:
+ <span class="keyword">new</span> <span
class="predefined-type">Book</span>(<span class="key">title</span>: <span
class="string"><span class="delimiter">'</span><span class="content">Grails in
Action</span><span class="delimiter">'</span></span>).save(<span
class="key">flush</span>: <span class="predefined-constant">true</span>, <span
class="key">failOnError</span>: <span class="predefined-constant">true</span>)
+
+ <span class="key">then</span>:
+ <span class="predefined-type">Book</span>.count() == <span
class="integer">1</span>
+ }
+
+ <span class="annotation">@Transactional</span>
+ <span class="type">void</span> <span class="string"><span
class="delimiter">"</span><span class="content">test 2 - data from test 1
is still available</span><span class="delimiter">"</span></span>() {
+ <span class="key">expect</span>: <span class="string"><span
class="delimiter">'</span><span class="content">data persists across
tests</span><span class="delimiter">'</span></span>
+ <span class="predefined-type">Book</span>.count() == <span
class="integer">1</span>
+ }
+
+ <span class="comment">// Database is cleaned once after both tests
complete</span>
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>This is useful when test methods build on each other’s data, or when
per-test cleanup is too expensive and a single cleanup at the end of the spec
is sufficient.</p>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+<code>cleanupAfterSpec</code> is only valid on class-level
<code>@DatabaseCleanup</code> annotations. Using it on a method-level
annotation will throw an <code>IllegalStateException</code>.
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+If individual methods within a <code>cleanupAfterSpec = true</code> spec also
have their own <code>@DatabaseCleanup</code> annotation, those methods will
still be cleaned up immediately after execution.
+</td>
+</tr>
+</table>
+</div>
<div class="admonitionblock warning">
<table>
<tr>