Author: sohil.shah(a)jboss.com
Date: 2009-01-19 10:54:33 -0500 (Mon, 19 Jan 2009)
New Revision: 12557
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java
Log:
JBPORTAL-2258 - Create file in CMS not working for several databases
* All setups work locally
* Oracle and Postgresql instance still breaking only in the QA lab. Something
environmental probably that QA team will look into
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java 2009-01-19
15:51:22 UTC (rev 12556)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java 2009-01-19
15:54:33 UTC (rev 12557)
@@ -480,7 +480,9 @@
*/
public void prepare(Object tx, List modifications, boolean one_phase) throws
Exception
{
+ Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
this.put(modifications);
+ session.flush();
}
/**
@@ -769,7 +771,6 @@
{
session.save(object);
}
- session.flush();
}
/**
@@ -784,7 +785,6 @@
{
Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
session.delete(removedValue);
- session.flush();
}
return removedValue;
}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2009-01-19
15:51:22 UTC (rev 12556)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2009-01-19
15:54:33 UTC (rev 12557)
@@ -499,8 +499,15 @@
//Save the changes during this session
session.save();
tx.commit();
+
+ //Hibernate cleanup.........somehow this is needed due to jdbc drivers for
oracle and postrgresql flaking
+ //out on BatchUpdate transactions issued by Hibernate session synchronization
+ org.hibernate.Session hibSession =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ hibSession.flush();
+ hibSession.clear();
+
if(isStartedHere)
- {
+ {
tm.commit();
}
}
Show replies by date