File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/mapping/naturalid/mutable Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -367,9 +367,10 @@ public void testEviction(SessionFactoryScope scope) {
367367 @ Test
368368 @ JiraKey ("HHH-7287" )
369369 public void testModificationInOtherSession (SessionFactoryScope factoryScope ) {
370- factoryScope .inTransaction ( (session ) -> {
370+ var id = factoryScope .fromTransaction ( (session ) -> {
371371 User u = new User ( "gavin" , "hb" , "secret" );
372372 session .persist ( u );
373+ return u .getId ();
373374 } );
374375
375376 // Use transactionless session
@@ -380,7 +381,7 @@ public void testModificationInOtherSession(SessionFactoryScope factoryScope) {
380381
381382 // CHANGE natural-id values in another session
382383 factoryScope .inTransaction ( (otherSession ) -> {
383- var u = otherSession .find ( User .class , 1 );
384+ var u = otherSession .find ( User .class , id );
384385 u .setOrg ( "zz" );
385386 } );
386387 // CHANGE APPLIED
You can’t perform that action at this time.
0 commit comments