Skip to content

Hibernate Reactive Transaction warnings #52580

@hristoko

Description

@hristoko

Describe the bug

Quarkus 3.31.2 with hibernate reactive 3.2 throws warning related to unprocessed transaction statements in a shared session

Based on the release notes, reactive was updated to 3.2, orm was updated to 7.2
From the ORM release notes:

Changes in Behavior
Child Session Flush/Close Behavior
Session and StatelessSession which share transactional context with a parent now have slightly different semantics in regard to flushing and closing 
- when the parent is flushed, the child is flushed
- when the parent is closed, the child is closed

Do these warnings get thrown regardless of whether there are outstanding statements
Is this behavior related to this issue?
hibernate/hibernate-reactive#2960

Expected behavior

There should be no unprocessed transaction completion actions

Actual behavior

Logs

WARN  [org.hibernate.orm.session] (vert.x-eventloop-thread-3) HHH90010101: Closing shared session with unprocessed transaction completion actions
WARN  [org.hibernate.orm.session] (vert.x-eventloop-thread-3) HHH90010108: Closing session with unprocessed clean up bulk operations, forcing their execution

How to Reproduce?

Quarkus 3.31.2 with rest and hibernate reactive

import io.smallrye.mutiny.Uni;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import org.hibernate.reactive.mutiny.Mutiny.SessionFactory;

@Path("/chain")
@ApplicationScoped
public class Chain {

    @Inject
    SessionFactory sf;

    @GET
   
    public Uni<Integer> chain() {
        return sf.withTransaction(
                (s, t) -> s.createNativeQuery("SELECT 1").executeUpdate()
                .chain(() -> s.createNativeQuery("SELECT 2").executeUpdate())
                .call(s::flush)   // should be auto flushed when transactions commits, added for effect
        );
    }
}

Output of uname -a or ver

Microsoft Windows [Version 10.0.26200.7623]

Output of java -version

OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)

Quarkus version or git rev

3.31.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions