From 192cb275fbbc76260524c9aa5e02cbcfcf5435fd Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 22 Jun 2023 12:00:09 +0200 Subject: [PATCH] HHH-16820 updated migration guide --- migration-guide.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/migration-guide.adoc b/migration-guide.adoc index 7b859e77c0..d4e9e70e8a 100644 --- a/migration-guide.adoc +++ b/migration-guide.adoc @@ -14,3 +14,16 @@ earlier versions, see any other pertinent migration guides as well. * link:{docsBase}/6.1/migration-guide/migration-guide.html[6.1 Migration guide] * link:{docsBase}/6.0/migration-guide/migration-guide.html[6.0 Migration guide] +[[batch-fetching-changes]] +== Batch Fetching and LockMode + +When LockMode is greater than READ Hibernate does not execute the batch fetching so existing uninitialized proxies will not be initialized. +This because the lock mode is different from the one of the proxies in the batch fetch queue. + +E.g. + +` +MyEntity proxy = session.getReference( MyEntity.class, 1 ); +MyEntity myEntity = session.find(MyEntity.class, 2, LockMode.WRITE); +` +only the entity with id equals to 2 will be loaded but the proxy will not be initialized.