This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a commit to branch merge-hibernate6
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 03d9a22fe670d160695c3b86981cd802ded1ddc4
Author: Walter Duque de Estrada <[email protected]>
AuthorDate: Fri Aug 22 07:23:55 2025 -0500

    More updates
---
 .../orm/hibernate/HibernateGormStaticApiSpec.groovy    | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git 
a/grails-data-hibernate6/core/src/test/groovy/org/grails/orm/hibernate/HibernateGormStaticApiSpec.groovy
 
b/grails-data-hibernate6/core/src/test/groovy/org/grails/orm/hibernate/HibernateGormStaticApiSpec.groovy
index 89621d8e40..f647394a20 100644
--- 
a/grails-data-hibernate6/core/src/test/groovy/org/grails/orm/hibernate/HibernateGormStaticApiSpec.groovy
+++ 
b/grails-data-hibernate6/core/src/test/groovy/org/grails/orm/hibernate/HibernateGormStaticApiSpec.groovy
@@ -192,27 +192,17 @@ class HibernateGormStaticApiSpec extends 
HibernateGormDatastoreSpec {
         entity.name == "test"
     }
 
-    //TODO transaction is not working
-    void "Test withTransaction"() {
-        when:
-        HibernateGormStaticApiEntity.withTransaction { status ->
-            new HibernateGormStaticApiEntity(name: "test").save(failOnError: 
true)
-            status.setRollbackOnly()
-        }
-        def count = HibernateGormStaticApiEntity.count()
 
-        then:
-        count == 0
-    }
 
-    void "Test withSession"() {
+    void "TestwithSession"() {
         when:
-        def result = HibernateGormStaticApiEntity.withSession { s ->
+        HibernateGormStaticApiEntity.withSession { s ->
+            // In Hibernate 6, getIdentifier on a transient (not associated) 
instance throws TransientObjectException
             s.getIdentifier(new HibernateGormStaticApiEntity(name: "test"))
         }
 
         then:
-        result == null
+        thrown(org.springframework.dao.InvalidDataAccessApiUsageException)
     }
 
     //TODO The instance was not associated with this session

Reply via email to