You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Joseph Chen (JIRA)" <ji...@apache.org> on 2005/10/26 20:30:57 UTC

[jira] Created: (JCR-263) HibernatePersistenceManager fails to store NodeReferences

HibernatePersistenceManager fails to store NodeReferences
---------------------------------------------------------

         Key: JCR-263
         URL: http://issues.apache.org/jira/browse/JCR-263
     Project: Jackrabbit
        Type: Bug
    Versions: 1.0    
    Reporter: Joseph Chen


In the HibernatePersistenceManager, the method

store(NodeReferences refs, Session session) throws ItemStateException, HibernateException

does not properly persist NodeReferences.

The problem is caused by these lines:

        // destroy all the references before saving
        destroy(refs, session);

which come before the while loop that stores the references.  Since destroy() calls refs.clearAllReferences(), the while loop does no work.

The solution is to simply replace the destroy() method call with the HQL that the destory() executes.

i.e.
            session.delete("from org.apache.jackrabbit.core.state.orm.ORMNodeReference as nf where nf.targetId='" +
                           refs.getTargetId().toString() +
                           "'");

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira