[ http://issues.apache.org/jira/browse/JCR-263?page=all ]

Roy T. Fielding updated JCR-263:
--------------------------------

    Component: contrib PMs

> HibernatePersistenceManager fails to store NodeReferences
> ---------------------------------------------------------
>
>          Key: JCR-263
>          URL: http://issues.apache.org/jira/browse/JCR-263
>      Project: Jackrabbit
>         Type: Bug
>   Components: contrib PMs
>     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

Reply via email to