jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Chen (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-263) HibernatePersistenceManager fails to store NodeReferences
Date Wed, 26 Oct 2005 18:30:57 GMT
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()

            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:
For more information on JIRA, see:

View raw message