Refreshing an entity clears the lock mode returned from EntityManager.getLockMode not working again. https://hibernate.atlassian.net/browse/HHH-12257
Fixed in 5.2.18 but in and higher 5.3.0 same bug