matrei commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3451556626


##########
grails-data-hibernate5/core/src/test/groovy/grails/gorm/tests/Hibernate5OptimisticLockingSpec.groovy:
##########
@@ -44,29 +69,36 @@ class Hibernate5OptimisticLockingSpec extends 
GrailsDataTckSpec<GrailsDataHibern
 
         when:
         OptLockVersioned.withTransaction {
-            o = OptLockVersioned.get(o.id)
+            try {
+                o = OptLockVersioned.get(o.id)
+
+                Thread.start {
+                    OptLockVersioned.withTransaction { s ->
+                        def reloaded = OptLockVersioned.get(o.id)
+                        assert reloaded
+                        assert reloaded != o
+                        reloaded.name += ' in new session'
+                        reloaded.save(flush: true)
+                        assert reloaded.version == 1
+                        assert o.version == 0
+                    }
+
+                }.join()
+
+                o.name += ' in main session'
+                o.save(flush: true)
 
-            Thread.start {
-                OptLockVersioned.withTransaction { s ->
-                    def reloaded = OptLockVersioned.get(o.id)
-                    assert reloaded
-                    assert reloaded != o
-                    reloaded.name += ' in new session'
-                    reloaded.save(flush: true)
-                    assert reloaded.version == 1
-                    assert o.version == 0
+                manager.session.clear()
+                o = OptLockVersioned.get(o.id)
+            } catch (Throwable e) {
+                System.getProperties().each { key, value ->
+                    println "${key}: ${value}"
                 }
-
-            }.join()
-
-            o.name += ' in main session'
-            o.save(flush: true)
-
-            manager.session.clear()
-            o = OptLockVersioned.get(o.id)
+                throw e
+            }
         }
         then:
-        thrown HibernateOptimisticLockingFailureException
+        thrown OptimisticLockingFailureException

Review Comment:
   Seems this was changed back to `HibernateOptimisticLockingFailureException` 
in b2b024ce.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to