Author: sohil.shah(a)jboss.com
Date: 2009-01-15 01:38:09 -0500 (Thu, 15 Jan 2009)
New Revision: 12511
Added:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JackRabbitTransaction.java
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
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/VersionBinVal.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
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/util/HibernateUtil.java
Log:
JBPORTAL-2258 - Create file in CMS not working for several databases
* backing up some code.
* oracle, mysql5, and hsqldb finally stable in both standalone/portal integration
* some issue still open for postgresql
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/CMSEntry.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -23,8 +23,6 @@
package org.jboss.portal.cms.hibernate;
import java.io.Serializable;
-import org.hibernate.Hibernate;
-import org.jboss.portal.common.io.IOTools;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class CMSEntry implements Serializable
@@ -35,11 +33,9 @@
private Integer key;
private String path;
private String name;
- //private java.sql.Blob data;
+ private java.sql.Blob data;
private long lastmod;
private long length;
-
- private byte[] blobData;
public CMSEntry()
{
@@ -49,11 +45,10 @@
{
this.key = null;
this.path = path;
- this.name = name;
+ this.name = name;
+ this.data = data;
this.lastmod = lastmod;
this.length = length;
-
- this.setData(data);
}
public Integer getKey()
@@ -86,6 +81,16 @@
this.name = name;
}
+ public java.sql.Blob getData()
+ {
+ return data;
+ }
+
+ public void setData(java.sql.Blob data)
+ {
+ this.data = data;
+ }
+
public long getLastmod()
{
return lastmod;
@@ -105,31 +110,4 @@
{
this.length = length;
}
-
- public java.sql.Blob getData()
- {
- java.sql.Blob blob = null;
-
- if(this.blobData != null)
- {
- blob = Hibernate.createBlob(this.blobData);
- }
-
- return blob;
- }
-
- public void setData(java.sql.Blob data)
- {
- try
- {
- if(data != null)
- {
- this.blobData = IOTools.getBytes(data.getBinaryStream());
- }
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
- }
}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/HibernateStore.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -955,7 +955,7 @@
versionEntry.setLength(length);
session.save(versionEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
@@ -975,7 +975,7 @@
cmsEntry.setLength(length);
session.save(cmsEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
@@ -995,7 +995,7 @@
repoEntry.setLength(length);
session.save(repoEntry);
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
@@ -1023,7 +1023,7 @@
VersionEntry versionEntry = new VersionEntry(parentDir, name,
Hibernate.createBlob(in), System.currentTimeMillis(), length);
session.save(versionEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
@@ -1031,7 +1031,7 @@
CMSEntry cmsEntry = new CMSEntry(parentDir, name,
Hibernate.createBlob(in), System.currentTimeMillis(), length);
session.save(cmsEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
@@ -1039,7 +1039,7 @@
RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name,
Hibernate.createBlob(in), System.currentTimeMillis(), length);
session.save(repoEntry);
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
@@ -1176,7 +1176,7 @@
versionEntry.setLength(length);
session.save(versionEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
@@ -1196,7 +1196,7 @@
cmsEntry.setLength(length);
session.save(cmsEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
@@ -1217,7 +1217,7 @@
repoEntry.setLength(length);
session.save(repoEntry);
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
@@ -1245,7 +1245,7 @@
VersionEntry versionEntry = new VersionEntry(parentDir, name,
Hibernate.createBlob(in), System.currentTimeMillis(), length);
session.save(versionEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
@@ -1253,7 +1253,7 @@
CMSEntry cmsEntry = new CMSEntry(parentDir, name,
Hibernate.createBlob(in), System.currentTimeMillis(), length);
session.save(cmsEntry);
- //session.flush();
+ session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
@@ -1261,7 +1261,7 @@
RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name,
Hibernate.createBlob(in), System.currentTimeMillis(), length);
session.save(repoEntry);
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
@@ -1508,21 +1508,20 @@
VersionEntry versionEntry = new VersionEntry(parentDir, name, null,
System.currentTimeMillis(), 0);
session.save(versionEntry);
- //session.flush();
+ session.flush();
}
else if (schemaObjectPrefix.equals(HibernateStoreConstants.cmsClassName))
{
CMSEntry cmsEntry = new CMSEntry(parentDir, name, null,
System.currentTimeMillis(), 0);
session.save(cmsEntry);
- //session.flush();
}
else if
(schemaObjectPrefix.equals(HibernateStoreConstants.repositoryClassName))
{
RepositoryEntry repoEntry = new RepositoryEntry(parentDir, name, null,
System.currentTimeMillis(), 0);
session.save(repoEntry);
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/RepositoryEntry.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -23,8 +23,6 @@
package org.jboss.portal.cms.hibernate;
import java.io.Serializable;
-import org.hibernate.Hibernate;
-import org.jboss.portal.common.io.IOTools;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class RepositoryEntry implements Serializable
@@ -35,11 +33,9 @@
private Integer key;
private String path;
private String name;
- //private java.sql.Blob data;
+ private java.sql.Blob data;
private long lastmod;
private long length;
-
- private byte[] blobData;
public RepositoryEntry()
{
@@ -50,10 +46,9 @@
this.key = null;
this.path = path;
this.name = name;
+ this.data = data;
this.lastmod = lastmod;
this.length = length;
-
- this.setData(data);
}
public Integer getKey()
@@ -86,6 +81,16 @@
this.name = name;
}
+ public java.sql.Blob getData()
+ {
+ return data;
+ }
+
+ public void setData(java.sql.Blob data)
+ {
+ this.data = data;
+ }
+
public long getLastmod()
{
return lastmod;
@@ -105,31 +110,4 @@
{
this.length = length;
}
-
- public java.sql.Blob getData()
- {
- java.sql.Blob blob = null;
-
- if(this.blobData != null)
- {
- blob = Hibernate.createBlob(this.blobData);
- }
-
- return blob;
- }
-
- public void setData(java.sql.Blob data)
- {
- try
- {
- if(data != null)
- {
- this.blobData = IOTools.getBytes(data.getBinaryStream());
- }
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
- }
}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/VersionEntry.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -23,8 +23,6 @@
package org.jboss.portal.cms.hibernate;
import java.io.Serializable;
-import org.hibernate.Hibernate;
-import org.jboss.portal.common.io.IOTools;
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class VersionEntry implements Serializable
@@ -35,11 +33,9 @@
private Integer key;
private String path;
private String name;
- //private java.sql.Blob data;
+ private java.sql.Blob data;
private long lastmod;
private long length;
-
- private byte[] blobData;
public VersionEntry()
{
@@ -49,11 +45,10 @@
{
this.key = null;
this.path = path;
- this.name = name;
+ this.name = name;
+ this.data = data;
this.lastmod = lastmod;
this.length = length;
-
- this.setData(data);
}
public Integer getKey()
@@ -86,6 +81,16 @@
this.name = name;
}
+ public java.sql.Blob getData()
+ {
+ return data;
+ }
+
+ public void setData(java.sql.Blob data)
+ {
+ this.data = data;
+ }
+
public long getLastmod()
{
return lastmod;
@@ -105,31 +110,4 @@
{
this.length = length;
}
-
- public java.sql.Blob getData()
- {
- java.sql.Blob blob = null;
-
- if(this.blobData != null)
- {
- blob = Hibernate.createBlob(this.blobData);
- }
-
- return blob;
- }
-
- public void setData(java.sql.Blob data)
- {
- try
- {
- if(data != null)
- {
- this.blobData = IOTools.getBytes(data.getBinaryStream());
- }
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
- }
}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -1527,7 +1527,7 @@
//versionNode.setData(IOTools.getBytes(in));
versionNode.setData(Hibernate.createBlob(in));
- //session.flush();
+ session.flush();
}
else if (schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.wspPrefix))
@@ -1542,7 +1542,7 @@
//wspNode.setData(IOTools.getBytes(in));
wspNode.setData(Hibernate.createBlob(in));
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
@@ -1571,7 +1571,7 @@
Hibernate.createBlob(in));
session.save(versionNode);
- //session.flush();
+ session.flush();
}
else if (schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.wspPrefix))
@@ -1580,7 +1580,7 @@
WSPBinVal wspNode = new WSPBinVal(blobId, Hibernate.createBlob(in));
session.save(wspNode);
- //session.flush();
+ session.flush();
}
}
catch (Exception e)
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-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/PortalCMSCacheLoader.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -691,168 +691,103 @@
return oldValue;
}
-
//-----------------------------------------------------------------------------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/**
- *
- *
- */
- private Set getChildrenNames(String query) throws Exception
- {
- Set children = null;
- Session session = null;
- Transaction tx = null;
- try
- {
- session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- tx = session.beginTransaction();
- List rs = session.createQuery(query).list();
- for (Iterator itr = rs.iterator(); itr.hasNext();)
- {
- String id = (String)itr.next();
- if (children == null)
- {
- children = new HashSet();
- }
- children.add(PortalCMSCacheLoader.parseNodeName(id));
- }
- }
- catch(Exception e)
- {
- if(tx != null)
- {
- tx.rollback();
- }
- throw e;
- }
- return children;
- }
+ *
+ *
+ */
+ private Set getChildrenNames(String query) throws Exception
+ {
+ Set children = null;
+ Session session = null;
+ session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- /**
- *
- *
- */
- private Object loadNode(String query, String id) throws Exception
- {
- Object node = null;
- Session session = null;
- Transaction tx = null;
- try
- {
- session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- tx = session.beginTransaction();
-
- //node = session.createQuery(query).setString(0,id).uniqueResult();
- List rs = session.createQuery(query).setString(0, id).list();
- if (rs != null && !rs.isEmpty())
- {
- node = rs.iterator().next();
- }
- }
- catch(Exception e)
- {
- if(tx != null)
- {
- tx.rollback();
- }
- throw e;
- }
- return node;
- }
+ List rs = session.createQuery(query).list();
+ for (Iterator itr = rs.iterator(); itr.hasNext();)
+ {
+ String id = (String)itr.next();
+ if (children == null)
+ {
+ children = new HashSet();
+ }
+ children.add(PortalCMSCacheLoader.parseNodeName(id));
+ }
+
+ return children;
+ }
- /**
- *
- *
- */
- private Object loadManagedNode(String query, String id) throws Exception
- {
- Object node = null;
- Session session = null;
- Transaction tx = null;
- try
- {
- session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- tx = session.beginTransaction();
-
- //node = session.createQuery(query).setString(0,id).uniqueResult();
- List rs = session.createQuery(query).setString(0, id).list();
- if (rs != null && !rs.isEmpty())
- {
- node = rs.iterator().next();
- }
- return node;
- }
- catch(Exception e)
- {
- if(tx != null)
- {
- tx.rollback();
- }
- throw e;
- }
- }
+ /**
+ *
+ *
+ */
+ private Object loadNode(String query, String id) throws Exception
+ {
+ Object node = null;
+ Session session = null;
+ session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- /**
- *
- */
- private void save(Object object) throws Exception
- {
- Session session = null;
- Transaction tx = null;
- try
- {
- session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- tx = session.beginTransaction();
-
- if (((Base)object).getKey() != null)
- {
- session.merge(object);
- }
- else
- {
- session.save(object);
- }
- }
- catch(Exception e)
- {
- if(tx != null)
- {
- tx.rollback();
- }
- throw e;
- }
- }
+ //node = session.createQuery(query).setString(0,id).uniqueResult();
+ List rs = session.createQuery(query).setString(0, id).list();
+ if (rs != null && !rs.isEmpty())
+ {
+ node = rs.iterator().next();
+ }
+
+ return node;
+ }
- /**
- *
- *
- */
- private Object delete(String loadQuery, String id) throws Exception
- {
- Session session = null;
- Transaction tx = null;
- try
- {
- Object removedValue = null;
- removedValue = this.loadManagedNode(loadQuery, id);
- if (removedValue != null)
- {
- session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- tx = session.beginTransaction();
-
- session.delete(removedValue);
- }
- return removedValue;
- }
- catch(Exception e)
- {
- if(tx != null)
- {
- tx.rollback();
- }
- throw e;
- }
- }
+ /**
+ *
+ *
+ */
+ private Object loadManagedNode(String query, String id) throws Exception
+ {
+ Object node = null;
+ Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ //node = session.createQuery(query).setString(0,id).uniqueResult();
+ List rs = session.createQuery(query).setString(0, id).list();
+ if (rs != null && !rs.isEmpty())
+ {
+ node = rs.iterator().next();
+ }
+
+ return node;
+ }
+
+ /**
+ *
+ */
+ private void save(Object object) throws Exception
+ {
+ Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ if (((Base)object).getKey() != null)
+ {
+ session.merge(object);
+ }
+ else
+ {
+ session.save(object);
+ }
+ session.flush();
+ }
+
+ /**
+ *
+ *
+ */
+ private Object delete(String loadQuery, String id) throws Exception
+ {
+ Object removedValue = null;
+ removedValue = this.loadManagedNode(loadQuery, id);
+ if (removedValue != null)
+ {
+ Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ session.delete(removedValue);
+ session.flush();
+ }
+ return removedValue;
+ }
//---------------nodeName related
methods-------------------------------------------------------------------------------------------------------------
/**
*
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/VersionBinVal.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -24,9 +24,6 @@
import java.io.Serializable;
-import org.hibernate.Hibernate;
-import org.jboss.portal.common.io.IOTools;
-
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class VersionBinVal implements Serializable
{
@@ -35,9 +32,7 @@
private Integer key;
private String id;
- //private java.sql.Blob data;
-
- private byte[] blobData;
+ private java.sql.Blob data;
public VersionBinVal()
{
@@ -47,8 +42,7 @@
{
this.key = null;
this.id = id;
-
- this.setData(data);
+ this.data = data;
}
public Integer getKey()
@@ -73,28 +67,11 @@
public java.sql.Blob getData()
{
- java.sql.Blob blob = null;
-
- if(this.blobData != null)
- {
- blob = Hibernate.createBlob(this.blobData);
- }
-
- return blob;
+ return data;
}
public void setData(java.sql.Blob data)
{
- try
- {
- if(data != null)
- {
- this.blobData = IOTools.getBytes(data.getBinaryStream());
- }
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
+ this.data = data;
}
}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/WSPBinVal.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -24,9 +24,6 @@
import java.io.Serializable;
-import org.hibernate.Hibernate;
-import org.jboss.portal.common.io.IOTools;
-
/** @author <a href="mailto:roy@jboss.org">Roy Russo</a> */
public class WSPBinVal implements Serializable
{
@@ -35,8 +32,7 @@
private Integer key;
private String id;
- //private java.sql.Blob data;
- private byte[] blobData;
+ private java.sql.Blob data;
public WSPBinVal()
{
@@ -46,8 +42,7 @@
{
this.key = null;
this.id = id;
-
- this.setData(data);
+ this.data = data;
}
public Integer getKey()
@@ -72,28 +67,11 @@
public java.sql.Blob getData()
{
- java.sql.Blob blob = null;
-
- if(this.blobData != null)
- {
- blob = Hibernate.createBlob(this.blobData);
- }
-
- return blob;
+ return data;
}
public void setData(java.sql.Blob data)
{
- try
- {
- if(data != null)
- {
- this.blobData = IOTools.getBytes(data.getBinaryStream());
- }
- }
- catch(Exception e)
- {
- throw new RuntimeException(e);
- }
+ this.data = data;
}
}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -42,6 +42,7 @@
import org.jboss.portal.cms.security.PortalCMSSecurityContext;
import org.jboss.portal.cms.util.HibernateUtil;
import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.User;
@@ -167,8 +168,68 @@
{
this.cmsSessionFactory = cmsSessionFactory;
}
-
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
/**
+ * This turns off acl security only for a particular thread. This is used by system
level operations that need to
+ * integrate with the CMS
+ * <p/>
+ * Example is: the workflow daemon that publishes a content as live when a manager
approves it. Without turning this
+ * off, the daemon thread is running in Anonymous mode which obviously does not have
the rights to publish the
+ * content
+ */
+ private static ThreadLocal turnOff = new ThreadLocal();
+
+ public static void turnOff()
+ {
+ ACLInterceptor.turnOff.set(new Boolean(true));
+ }
+
+ public static void turnOn()
+ {
+ ACLInterceptor.turnOff.set(null);
+ }
+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ public void start() throws Exception
+ {
+ log.info("AuthorizationManager initialized=" +
this.authorizationManager);
+
+ if (this.jndiName != null)
+ {
+ this.jndiBinding = new JNDI.Binding(jndiName, this);
+ this.jndiBinding.bind();
+ }
+
+ try
+ {
+ roleModule = (RoleModule)new
InitialContext().lookup("java:portal/RoleModule");
+ }
+ catch (NamingException e)
+ {
+ log.error("Cannot obtain RoleModule from JNDI: ", e);
+ throw e;
+ }
+
+ //check and see if cms permissions exist...if not, boot it with the default policy
+ //specified in the configuration
+ if (!this.isBootRequired())
+ {
+ return;
+ }
+
+ //go ahead and boot the cms access policy with default policy specified in the
configuration
+ this.initBootPolicy();
+ }
+
+ public void stop() throws Exception
+ {
+ if (this.jndiBinding != null)
+ {
+ this.jndiBinding.unbind();
+ this.jndiBinding = null;
+ }
+ }
+
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
*
*/
protected Object invoke(JCRCommand invocation) throws Exception, InvocationException
@@ -218,161 +279,8 @@
return invocation.invokeNext();
}
}
-
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/**
- *
- */
- public void start() throws Exception
- {
- Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- log.info("AuthorizationManager initialized=" +
this.authorizationManager);
-
- if (this.jndiName != null)
- {
- this.jndiBinding = new JNDI.Binding(jndiName, this);
- this.jndiBinding.bind();
- }
-
-
- this.initRoleModule();
-
- //check and see if cms permissions exist...if not, boot it with the default policy
- //specified in the configuration
- if (!this.isBootRequired())
- {
- return;
- }
-
- //go ahead and boot the cms access policy with default policy specified in the
configuration
- this.storeBootPolicy();
-
- tx.commit();
- }
- catch(Exception e)
- {
- log.error(this, e);
-
- if(tx != null)
- {
- tx.rollback();
- }
-
- throw e;
- }
- finally
- {
- if(session != null && session.isOpen())
- {
- session.close();
- }
- }
- }
-
- /** @throws Exception */
- public void stop() throws Exception
- {
- if (this.jndiBinding != null)
- {
- this.jndiBinding.unbind();
- this.jndiBinding = null;
- }
- }
-
- /**
- * This turns off acl security only for a particular thread. This is used by system
level operations that need to
- * integrate with the CMS
- * <p/>
- * Example is: the workflow daemon that publishes a content as live when a manager
approves it. Without turning this
- * off, the daemon thread is running in Anonymous mode which obviously does not have
the rights to publish the
- * content
- */
- private static ThreadLocal turnOff = new ThreadLocal();
-
- public static void turnOff()
- {
- ACLInterceptor.turnOff.set(new Boolean(true));
- }
-
- public static void turnOn()
- {
- ACLInterceptor.turnOff.set(null);
- }
-
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- private void initRoleModule() throws Exception
- {
- try
- {
- roleModule = (RoleModule)new
InitialContext().lookup("java:portal/RoleModule");
- }
- catch (NamingException e)
- {
- log.error("Cannot obtain RoleModule from JNDI: ", e);
- throw e;
- }
- }
-
- private void storeBootPolicy() throws Exception
- {
- InputStream is = null;
- try
- {
- //process the specified defaultPolicy
- is = new ByteArrayInputStream(this.defaultPolicy.getBytes());
- Document document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
-
- NodeList criteria = document.getElementsByTagName("criteria");
- if (criteria != null)
- {
- for (int i = 0; i < criteria.getLength(); i++)
- {
- Element criteriaElem = (Element)criteria.item(i);
- String name = criteriaElem.getAttribute("name");
- String value = criteriaElem.getAttribute("value");
-
- //permission setup
- NodeList permissions =
criteriaElem.getElementsByTagName("permission");
- if (permissions != null)
- {
- Session session = null;
- Transaction tx = null;
- Collection parsedPermissions =
this.parseDefaultPermissions(permissions);
- try
- {
- session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
- tx = session.beginTransaction();
- for (Iterator itr = parsedPermissions.iterator(); itr.hasNext();)
- {
- Permission permission = (Permission)itr.next();
- permission.addCriteria(new Criteria(name, value));
- Set securityBinding = new HashSet();
- securityBinding.add(permission);
- this.authorizationManager.getProvider().setSecurityBindings(null,
securityBinding);
- }
- }
- catch (Exception e)
- {
- if(tx != null)
- {
- tx.rollback();
- }
- }
- }
- }
- }
- }
- finally
- {
- if (is != null)
- {
- is.close();
- }
- }
- }
-
- /**
* Filters any files/folders based on the user's access. The filter is applied to
folders/files returned by invoking
* a CMS command
*
@@ -454,9 +362,73 @@
}
return filteredResponse;
}
-
+ private void initBootPolicy() throws Exception
+ {
+ InputStream is = null;
+ try
+ {
+ //process the specified defaultPolicy
+ is = new ByteArrayInputStream(this.defaultPolicy.getBytes());
+ Document document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
+ NodeList criteria = document.getElementsByTagName("criteria");
+ if (criteria != null)
+ {
+ for (int i = 0; i < criteria.getLength(); i++)
+ {
+ Element criteriaElem = (Element)criteria.item(i);
+ String name = criteriaElem.getAttribute("name");
+ String value = criteriaElem.getAttribute("value");
+
+ //permission setup
+ NodeList permissions =
criteriaElem.getElementsByTagName("permission");
+ if (permissions != null)
+ {
+ Session session = null;
+ Transaction tx = null;
+ Collection parsedPermissions =
this.parseDefaultPermissions(permissions);
+ try
+ {
+ session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
+ tx = session.beginTransaction();
+ for (Iterator itr = parsedPermissions.iterator(); itr.hasNext();)
+ {
+ Permission permission = (Permission)itr.next();
+ permission.addCriteria(new Criteria(name, value));
+ Set securityBinding = new HashSet();
+ securityBinding.add(permission);
+ this.authorizationManager.getProvider().setSecurityBindings(null,
securityBinding);
+ }
+ tx.commit();
+ }
+ catch (Exception e)
+ {
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ }
+ finally
+ {
+ if(session != null && session.isOpen())
+ {
+ session.close();
+ }
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ if (is != null)
+ {
+ is.close();
+ }
+ }
+ }
+
/**
* Parses and produces Permission objects for the default policy
*
@@ -505,16 +477,45 @@
* @return
*/
private Role getRole(String name) throws Exception
- {
- try
- {
- return this.roleModule.findRoleByName(name);
- }
- catch(Exception e)
- {
- log.debug(this, e);
- return null;
- }
+ {
+ Role role = null;
+
+ //since this is at app start up and not on user thread...need to create a
transaction context.
+ InitialContext context = new InitialContext();
+ SessionFactory sessionFactory =
(SessionFactory)context.lookup(this.identitySessionFactory);
+ Session session = sessionFactory.openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ role = this.roleModule.findRoleByName(name);
+ tx.commit();
+ }
+ catch(IdentityException ie)
+ {
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ return null;
+ }
+ catch (Exception e)
+ {
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ log.error(this, e);
+ throw e;
+ }
+ finally
+ {
+ if(session != null && session.isOpen())
+ {
+ session.close();
+ }
+ }
+
+ return role;
}
/**
@@ -527,7 +528,7 @@
boolean bootRequired = false;
String hsqlQuery = "select count(permission) from
org.jboss.portal.cms.security.Permission as permission";
- Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).getCurrentSession();
+ Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
Transaction tx = session.beginTransaction();
try
{
@@ -537,14 +538,22 @@
{
bootRequired = true;
}
+ tx.commit();
}
catch(Exception e)
{
- if(tx != null)
- {
- tx.rollback();
- }
- }
+ if(tx != null)
+ {
+ tx.rollback();
+ }
+ }
+ finally
+ {
+ if(session != null && session.isOpen())
+ {
+ session.close();
+ }
+ }
return bootRequired;
}
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-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -47,6 +47,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.invocation.InvocationHandler;
import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.transaction.TransactionManagerProvider;
import org.jboss.portal.common.net.URLNavigator;
import org.jboss.portal.common.net.URLVisitor;
import org.jboss.portal.common.xml.XMLTools;
@@ -60,10 +61,13 @@
import org.hibernate.Transaction;
+import javax.transaction.Status;
+import javax.transaction.UserTransaction;
+import javax.transaction.TransactionManager;
+import javax.naming.InitialContext;
+
import javax.jcr.Repository;
import javax.jcr.Session;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
@@ -325,10 +329,16 @@
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public void startService() throws Exception
{
- org.hibernate.Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
- Transaction tx = session.beginTransaction();
+ TransactionManager tm = null;
+ boolean isStartedHere = false;
try
- {
+ {
+ tm = TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ if(tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tm.begin();
+ isStartedHere = true;
+ }
if (this.jndiName != null)
{
@@ -348,31 +358,35 @@
watch.stop();
log.info("Started JCR CMS in: " + watch);
- tx.commit();
+ if(isStartedHere)
+ {
+ tm.commit();
+ }
}
catch(Exception e)
{
log.error(this, e);
- if(tx != null)
+
+ if(isStartedHere)
{
- tx.rollback();
+ tm.rollback();
}
- }
- finally
- {
- if(session !=null && session.isOpen())
- {
- session.close();
- }
- }
+ }
}
public void stopService()
- {
- org.hibernate.Session session =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
- Transaction tx = session.beginTransaction();
+ {
+ TransactionManager tm = null;
+ boolean isStartedHere = false;
try
- {
+ {
+ tm = TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ if(tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tm.begin();
+ isStartedHere = true;
+ }
+
if (jndiBinding != null)
{
jndiBinding.unbind();
@@ -381,29 +395,26 @@
log.info("Stopping JCR CMS");
stopJCR();
- tx.commit();
+ if(isStartedHere)
+ {
+ tm.commit();
+ }
}
catch(Exception e)
{
- if(tx != null)
- {
- try
- {
- tx.rollback();
- }
- catch(Exception tme)
- {
- log.error(this, tme);
- }
- }
- }
- finally
- {
- if(session !=null && session.isOpen())
- {
- session.close();
- }
- }
+ try
+ {
+ if(isStartedHere)
+ {
+ tm.rollback();
+ }
+ }
+ catch(Exception rbe)
+ {
+ throw new RuntimeException(rbe);
+ }
+ throw new RuntimeException(e);
+ }
}
public Object execute(Command cmd) throws CMSException
@@ -417,37 +428,27 @@
{
throw new RuntimeException(e); // Fixme
}
- // get XAResource
- XAResource xares = session.getXAResource();
-
- // create dummy Xid
- Xid xid = new Xid()
- {
- public byte[] getBranchQualifier()
- {
- return new byte[0];
- }
-
- public int getFormatId()
- {
- return 0;
- }
-
- public byte[] getGlobalTransactionId()
- {
- return new byte[0];
- }
- };
-
+
Object obj = null;
boolean isClusterDelegatedRequest = false; //used to indicate this request is from
another cluster node instead of the master node
boolean clusterWorkflowStatus = false;
- org.hibernate.Session hibernateSession =
HibernateUtil.getSessionFactory(this.cmsSessionFactory).openSession();
- Transaction tx = hibernateSession.beginTransaction();
+
+ TransactionManager tm = null;
+ org.hibernate.Session hibernateSession = null;
+ UserTransaction tx = null;
+ boolean isStartedHere = false;
try
- {
- xares.start(xid, XAResource.TMNOFLAGS);
-
+ {
+ tm = TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ if(tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ tm.begin();
+ isStartedHere = true;
+ }
+ hibernateSession =
HibernateUtil.getSessionFactory(cmsSessionFactory).getCurrentSession();
+ tx = new JackRabbitTransaction(session);
+ tx.begin();
+
//Check and make sure in the case of a clustered call, the Identity propagated
//as part of the invocation is handled correctly
JCRCommandContext propagatedContext =
(JCRCommandContext)((JCRCommand)cmd).getContext();
@@ -504,32 +505,35 @@
obj = jcrCmd.execute();
}
- //committ the transaction
- xares.end(xid, XAResource.TMSUCCESS);
- xares.prepare(xid);
+ //Save the changes during this session
session.save();
- xares.commit(xid, false);
-
- tx.commit();
+ tx.commit();
+ if(isStartedHere)
+ {
+ tm.commit();
+ }
}
catch (Exception e)
{
log.error(this, e);
- try
+
+ if(tx != null)
{
- xares.rollback(xid);
+ try
+ {
+ tx.rollback();
+ }
+ catch(Exception rbe)
+ {
+ log.error(this, rbe);
+ }
}
- catch (Exception ex)
- {
- //we tried to roll it back...not sure what more we can do here
- throw new CMSException(ex);
- }
- if(tx != null)
+ if(isStartedHere)
{
try
{
- tx.rollback();
+ tm.rollback();
}
catch(Exception rbe)
{
@@ -551,12 +555,13 @@
}
}
finally
- {
+ {
if (session != null)
{
//must do this otherwise, the whole cms will hang
session.logout();
}
+
if (isClusterDelegatedRequest)
{
JCRCMS.getUserInfo().set(null);
@@ -564,11 +569,7 @@
if (clusterWorkflowStatus)
{
JCRCMS.turnOnWorkflow();
- }
- if(hibernateSession !=null && hibernateSession.isOpen())
- {
- hibernateSession.close();
- }
+ }
}
return obj;
}
Added:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JackRabbitTransaction.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JackRabbitTransaction.java
(rev 0)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/impl/jcr/JackRabbitTransaction.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -0,0 +1,246 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.portal.cms.impl.jcr;
+
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import javax.transaction.xa.XAException;
+import javax.transaction.UserTransaction;
+import javax.transaction.Status;
+import javax.transaction.NotSupportedException;
+import javax.transaction.SystemException;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.RollbackException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.api.XASession;
+
+/**
+ * Internal {@link javax.transaction.UserTransaction} implementation.
+ */
+public class JackRabbitTransaction implements UserTransaction
+{
+
+ /**
+ * Global transaction id counter
+ */
+ private static byte counter = 0;
+
+ /**
+ * XAResource
+ */
+ private final XAResource xares;
+
+ /**
+ * Xid
+ */
+ private Xid xid;
+
+ /**
+ * Status
+ */
+ private int status = Status.STATUS_NO_TRANSACTION;
+
+ /**
+ * Create a new instance of this class. Takes a session as parameter.
+ * @param session session. If session is not of type
+ * {@link XASession}, an <code>IllegalArgumentException</code>
+ * is thrown
+ */
+ public JackRabbitTransaction(Session session)
+ {
+ if (session instanceof XASession)
+ {
+ xares = ((XASession) session).getXAResource();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Session not of type
XASession");
+ }
+ }
+
+ /**
+ * @see javax.transaction.UserTransaction#begin
+ */
+ public void begin() throws NotSupportedException, SystemException
+ {
+ if (status != Status.STATUS_NO_TRANSACTION)
+ {
+ throw new IllegalStateException("Transaction already active");
+ }
+
+ try
+ {
+ xid = new XidImpl(counter++);
+ xares.start(xid, XAResource.TMNOFLAGS);
+ status = Status.STATUS_ACTIVE;
+
+ } catch (XAException e)
+ {
+ e.printStackTrace();
+ throw new SystemException("Unable to begin transaction: " +
+ "XA_ERR=" + e.errorCode);
+ }
+ }
+
+ /**
+ * @see javax.transaction.UserTransaction#commit
+ */
+ public void commit() throws HeuristicMixedException,
+ HeuristicRollbackException, IllegalStateException,
+ RollbackException, SecurityException, SystemException
+ {
+
+ if (status != Status.STATUS_ACTIVE)
+ {
+ throw new IllegalStateException("Transaction not active");
+ }
+
+ try
+ {
+ xares.end(xid, XAResource.TMSUCCESS);
+
+ status = Status.STATUS_PREPARING;
+ xares.prepare(xid);
+ status = Status.STATUS_PREPARED;
+
+ status = Status.STATUS_COMMITTING;
+ xares.commit(xid, false);
+ status = Status.STATUS_COMMITTED;
+
+ } catch (XAException e)
+ {
+
+ if (e.errorCode >= XAException.XA_RBBASE &&
+ e.errorCode <= XAException.XA_RBEND)
+ {
+ RollbackException re = new RollbackException(
+ "Transaction rolled back: XA_ERR=" + e.errorCode);
+ re.initCause(e.getCause());
+ throw re;
+ } else
+ {
+ SystemException se = new SystemException(
+ "Unable to commit transaction: XA_ERR=" +
e.errorCode);
+ se.initCause(e.getCause());
+ throw se;
+ }
+ }
+ }
+
+ /**
+ * @see javax.transaction.UserTransaction#getStatus
+ */
+ public int getStatus() throws SystemException
+ {
+ return status;
+ }
+
+ /**
+ * @see javax.transaction.UserTransaction#rollback
+ */
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException
+ {
+
+ if (status != Status.STATUS_ACTIVE &&
+ status != Status.STATUS_MARKED_ROLLBACK)
+ {
+
+ throw new IllegalStateException("Transaction not active");
+ }
+
+ try
+ {
+ xares.end(xid, XAResource.TMFAIL);
+
+ status = Status.STATUS_ROLLING_BACK;
+ xares.rollback(xid);
+ status = Status.STATUS_ROLLEDBACK;
+ }
+ catch (XAException e)
+ {
+ SystemException se = new SystemException(
+ "Unable to rollback transaction: XA_ERR=" + e.errorCode);
+ se.initCause(e.getCause());
+ throw se;
+ }
+ }
+
+ /**
+ * @see javax.transaction.UserTransaction#setRollbackOnly()
+ */
+ public void setRollbackOnly() throws IllegalStateException, SystemException
+ {
+ if (status != Status.STATUS_ACTIVE)
+ {
+ throw new IllegalStateException("Transaction not active");
+ }
+ status = Status.STATUS_MARKED_ROLLBACK;
+ }
+
+ /**
+ * @see javax.transaction.UserTransaction#setTransactionTimeout
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException {}
+
+
+ /**
+ * Internal {@link Xid} implementation.
+ */
+ class XidImpl implements Xid
+ {
+
+ /** Global transaction id */
+ private final byte[] globalTxId;
+
+ /**
+ * Create a new instance of this class. Takes a global
+ * transaction number as parameter
+ * @param globalTxNumber global transaction number
+ */
+ public XidImpl(byte globalTxNumber)
+ {
+ this.globalTxId = new byte[] { globalTxNumber };
+ }
+
+ /**
+ * @see javax.transaction.xa.Xid#getFormatId()
+ */
+ public int getFormatId()
+ {
+ return 0;
+ }
+
+ /**
+ * @see javax.transaction.xa.Xid#getBranchQualifier()
+ */
+ public byte[] getBranchQualifier()
+ {
+ return new byte[0];
+ }
+
+ /**
+ * @see javax.transaction.xa.Xid#getGlobalTransactionId()
+ */
+ public byte[] getGlobalTransactionId()
+ {
+ return globalTxId;
+ }
+ }
+}
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java 2009-01-14
20:53:21 UTC (rev 12510)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/util/HibernateUtil.java 2009-01-15
06:38:09 UTC (rev 12511)
@@ -48,20 +48,6 @@
}
}
- /** @return */
- /*public static Session getCurrentSession(SessionFactory sessionFactory)
- {
- Session session = sessionFactory.getCurrentSession();
- return session;
- }*/
-
- /** @return */
- /*public static Session getOpenSession(SessionFactory sessionFactory)
- {
- Session session = sessionFactory.openSession();
- return session;
- }*/
-
/** @param session */
public static void closeSession(Session session)
{