jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Stark" <Johannes.St...@gmx.de>
Subject Re: Adding nodes with references within a single transaction via webdav
Date Tue, 14 Jun 2011 08:34:51 GMT
Hi Angela,

we are using the Jackrabbit Standalone Server and access it via WebDav. So it's case b_.
Well what we do is to rebuild the JCR API in PHP. We have a PHP session that simulates the
JCR session. All changes made are cached by the PHP session. On $session->save() all changes
are written to Jackrabbit via webdav. It's working great unless for references to new nodes
within a session due to the unavailability of uuids. So our thought for the proceeding within
PHP was the following:

- start a PHP session
- begin transaction
- do some work in the PHP cache like adding nodes and properties (unless properties containing
- save session (write everything to Jackrabbit, uuids of new referencable nodes should be
available after that)
- create all references in the PHP cache 
- save session again (write references to Jackrabbit)
- commit transaction

We would like to do it this way because that would give us the ability to do a rollback in
case of an error during all the writing.

So I would be great if uuids of new referenceable nodes would be available immediately after
they were created via webdav within a transaction.

Kind regards,

-------- Original-Nachricht --------
> Datum: Fri, 10 Jun 2011 10:27:31 +0200
> Von: Angela Schreiber <anchela@adobe.com>
> An: users@jackrabbit.apache.org
> Betreff: Re: Adding nodes with references within a single transaction via webdav

> hi johannes
> the subject "Adding nodes with references within a single transaction 
> via webdav" somehow leaves me uncertain if i understand your issue.
> a_ are you taking about a jcr2spi repository?
> b_ or are you talking about the webdav server implementation?
> > What we definitely need for our CMF are references between JCR nodes.
> E.g. you would like to assign pages to menu items or you would like to have a
> picture on several pages and so on.
> > But one big problem for us is that you are not able to reference a node
> until it is persisted. We also had a look at transactions: same issue.
> Referenceable nodes will get their uuid not before the transaction is
> committed. So we are not able to persist two or more content items with references
> to each other within the same transaction. Well this behavior is totally in
> accordance to the spec.
> in case of a_:
> that's correct. node are only referenceable once the jcr:uuid property
> has been persisted. the reason for this is that the final nature of the
> uuid is defined by the backend and there is little jcr2spi can do about
> this (except if there was an explicit call to the spi-implementation to
> generate the uuid which would as well generated some extra round trips).
> in case of b_:
> i think that should be possible as the underlying jcr implementation is
> a jackrabbit-core which makes a node referenceable immediately.
> kind regards
> angela

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

View raw message