mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
15963: Fix ETHREEOH-1962: Hibernate flush ordering incorrect for alf_qname - This merge will come from V3.2 15972 as well, but should not cause issues git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16389 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -172,6 +172,9 @@ public class HibernateQNameDAOImpl extends HibernateDaoSupport implements QNameD
|
|||||||
Session session = getSession();
|
Session session = getSession();
|
||||||
Long id = (Long) session.save(namespace);
|
Long id = (Long) session.save(namespace);
|
||||||
DirtySessionMethodInterceptor.flushSession(session, true);
|
DirtySessionMethodInterceptor.flushSession(session, true);
|
||||||
|
// Force a flush because Hibernate doesn't always get the flush order right
|
||||||
|
// for DBs that use sequences for the PK: ETHREEOH-1962
|
||||||
|
DirtySessionMethodInterceptor.flushSession(getSession(), true);
|
||||||
// Cache it
|
// Cache it
|
||||||
namespaceEntityCache.put(id, namespaceUri);
|
namespaceEntityCache.put(id, namespaceUri);
|
||||||
namespaceEntityCache.put(namespaceUri, id);
|
namespaceEntityCache.put(namespaceUri, id);
|
||||||
@@ -300,6 +303,9 @@ public class HibernateQNameDAOImpl extends HibernateDaoSupport implements QNameD
|
|||||||
qnameEntity.setLocalName(localName);
|
qnameEntity.setLocalName(localName);
|
||||||
// Persist
|
// Persist
|
||||||
Long id = (Long) getSession().save(qnameEntity);
|
Long id = (Long) getSession().save(qnameEntity);
|
||||||
|
// Force a flush because Hibernate doesn't always get the flush order right
|
||||||
|
// for DBs that use sequences for the PK: ETHREEOH-1962
|
||||||
|
DirtySessionMethodInterceptor.flushSession(getSession(), true);
|
||||||
// Update the cache
|
// Update the cache
|
||||||
qnameEntityCache.put(qname, id);
|
qnameEntityCache.put(qname, id);
|
||||||
qnameEntityCache.put(id, qname);
|
qnameEntityCache.put(id, qname);
|
||||||
|
Reference in New Issue
Block a user