Skip to content

Merge 8.0.x into 8.1.x - #17140

Merged
codeconsole merged 22 commits into
apache:8.1.xfrom
codeconsole:merge/8.0.x-into-8.1.x
Nov 22, 2026
Merged

codeconsole merged 22 commits into
apache:8.1.xfrom
codeconsole:merge/8.0.x-into-8.1.x

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

Merges 8.0.x into 8.1.x, which brings #17085 from 7.0.x, and from 8.0.x: #17092 and #17093 (close the sessions of an asynchronous request when it completes, Hibernate 5 and 7), #16968 (ACL domain classes generated by s2-create-acl-domains), #16972 (the sec tags render nothing when the plugin is inactive), #16981 (one-line MongoDB index failure log), #17049 (subqueries in updateAll and deleteAll), and the conflict resolution of 8.0.x's own merge of 7.2.x (95b69f3), which adapts the 8.0.x-only BuildIndexesFailureSummarySpec to #16981 to this line.

No conflicts. The merge changes only files those commits change, plus that spec. No dependency version, Gradle version or .sdkmanrc changes; the build-script changes are the versionless compileOnly servlet API for the two OSIV interceptors, the inactive security test config in gradle.yml, and a trailing newline.

This branch is built on #17139 (7.2.x into 8.0.x), so merge that one first.

codeconsole and others added 22 commits November 19, 2026 18:01
…binds to the transaction

With synchronization active and no session bound, DatastoreUtils.getSession
binds the session it opens and registers a synchronization that unbinds and
closes it when the transaction completes. The interceptor skipped its own
bind but did not record that it joined that session, so it closed it when
the request completed, and the synchronization then failed to unbind it.
Record it as joined, as for a session bound before the request.
…t completes

The open session in view interceptor closed the sessions it opened as soon
as a request went asynchronous. A task that the action returned then failed
to lazily load an association of an entity the action had loaded: with a
LazyInitializationException, or with a NullPointerException from Hibernate
when it got there while the session was being closed.

The sessions are still taken off the thread when the request goes
asynchronous, so that the thread's next request does not use them. They are
now closed when the asynchronous request completes, from an AsyncListener on
the request's asynchronous context, which the container also calls after a
timeout or an error. Without an asynchronous context, they are closed at
once, as before.
…t completes

The open session in view interceptor closed the sessions it opened as soon
as a request went asynchronous. A task that the action returned then failed
to lazily load an association of an entity the action had loaded: with a
LazyInitializationException, or with a NullPointerException from Hibernate
when it got there while the session was being closed.

The sessions are still taken off the thread when the request goes
asynchronous, so that the thread's next request does not use them. They are
now closed when the asynchronous request completes, from an AsyncListener on
the request's asynchronous context, which the container also calls after a
timeout or an error. Without an asynchronous context, they are closed at
once, as before.
…re a timeout

For a Callable or DeferredResult, Spring starts the asynchronous request
before the open session in view interceptor runs, so the sessions of the
other datasources are closed when the request completes there too. A new
MultiDataSourceSessionSpec feature covers that path. The timeout feature
of OsivRequestSessionSpec now checks that the sessions stay open while
the request waits, so that it fails without the change.

The class Javadoc of GrailsOpenSessionInViewInterceptor says when the
sessions are closed, and the features that run without an asynchronous
context say so.
…re a timeout

For a Callable or DeferredResult, Spring starts the asynchronous request
before the open session in view interceptor runs, so the sessions of the
other datasources are closed when the request completes there too. A new
MultiDataSourceSessionSpec feature covers that path. The timeout feature
of OsivRequestSessionSpec now checks that the sessions stay open while
the request waits, so that it fails without the change.

The class Javadoc of GrailsOpenSessionInViewInterceptor says when the
sessions are closed, and the features that run without an asynchronous
context say so.
… not return leaves open

On 7.0.x, a task that an action starts and does not return makes the
request asynchronous without marking it as started by Grails. The open
session in view interceptor then leaves the default session to Spring,
which takes it off the thread and closes it in the dispatch that a
Callable or DeferredResult starts. When the task completes the request
itself, there is no such dispatch, and the session stayed open.

The interceptor now also closes that session when the asynchronous
request completes, unless it is closed by then. A new
OsivRequestSessionSpec feature has such a task complete the request,
and the Spring feature of MultiDataSourceSessionSpec now expects both
sessions closed when the request completes without a dispatch. Both
fail without the change.
…sync-request-completes-7.0.x

fix(hibernate5): close the sessions of an asynchronous request when it completes
…sync-request-completes-8.0.x

fix(hibernate7): close the sessions of an asynchronous request when it completes
…ters in order, joins its criteria with AND and has no WHERE without criteria (apache#17049)

JpaQueryBuilder wrote the subquery of an inList or notIn criterion into the bulk statements of updateAll and deleteAll
without advancing the parameter position past the parameters it added, so a criterion after it failed with
"Could not locate named parameter [p3], expecting one of [p1, p2]". It also wrote the criteria of a subquery one after
the other with no AND between them, and wrote WHERE for a subquery that has no criteria, which is not valid.

The position continues from the number of parameters after a subquery, in the In handler and in handleSubQuery, and
the criteria of a subquery are joined as a conjunction, with no WHERE when there are none.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…ace at debug (apache#16981)

MongoDatastore.initializeIndices logged a MongoCommandException from
createIndex at ERROR together with the exception, so a server error such
as 86 IndexKeySpecsConflict printed a huge stack trace at every startup
for a condition the operator must fix in the mapping or the database.

The ERROR event now carries only the entity, the index definition and the
server message; the stack trace goes to a separate DEBUG event. This
covers the single, compound and property index paths.

The module's tests ran on slf4j-nop, which cannot capture log events, so
logback-classic (managed by the BOM) replaces it as the single SLF4J
binding for the tests, and a new spec provokes a real index conflict
against a MongoDB container and asserts on the captured events.

Fixes apache#15667

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…active (apache#16972)

* fix(spring-security): render nothing from sec tags when the plugin is inactive

With grails.plugin.springsecurity.active = false the plugin defines none of
its beans, so a GSP using <sec:ifAllGranted> failed with "No bean named
'roleHierarchy' available". Every tag of SecurityTagLib now renders nothing
when the property is false; it still defaults to true.

Covered by SecurityTagLibInactiveSpec (all 13 tags) and, in the core
functional-test-app, by the new 'inactive' TESTCONFIG and
InactiveSecurityTagLibSpec.

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

* chore: trigger CI

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL

* [run tests] chore: run the tests

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…s compare and serialize as the plugin's (apache#16968)

The templates of AclClass, AclSid, AclEntry and AclObjectIdentity had no @EqualsAndHashCode and did not implement
Serializable, unlike the plugin's own domain classes. A generated copy compared by identity, and a generated
AclObjectIdentity compared equal to another with a different objectId, because the equality of its base class ignores
objectId. The ACL services look ACLs up by that equality, so an object whose ACL exists failed with a NotFoundException.

The templates now declare the same equality and serialVersionUID as the domain classes. GeneratedAclDomainsSpec renders each
template, compiles it and checks equality, hashCode and Serializable. The script does not overwrite an existing class, so
the documentation of s2-create-acl-domains says what to add to a copy generated earlier.

Fixes apache#15927

Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…-synchronization-7.0.x

fix(datastore-web): leave a session that transaction synchronization binds to the transaction
@codeconsole
codeconsole merged commit d9b4ce9 into apache:8.1.x Nov 22, 2026
31 of 93 checks passed
@testlens-app

testlens-app Bot commented Nov 22, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: dea9e0e
▶️ Tests: 11441 executed
⚪️ Checks: 99/99 completed


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants