You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Pill, Juergen" <Ju...@softwareag.com> on 2000/12/27 16:46:50 UTC

Multiple persistent stores

Hello,

I have following scenario:

The uri "/"  is managed by the default MemoryStore
The uri "/Patients" is managed by our self written TaminoStore. This
TaminoStore serializes all the data and writes them to file at commit and
read the serialized data at start up time. (please see attached domain.ini
file for more details)

I see now following problem:

The very first time slide starts up with out a problem, creating the
"/Patients" folder (all the descriptors starting with /Patients are written
to the serialized file). The second (and the next) start up of Slide do not
display the Patients folder any more.
This is caused by the method StructureImpl.ceate(...) called by
XMLUnmarshaller.loadObjectNode(...). In line 177 (milestone4) the object
declared in the xml file (/Patients) is created (structure.create). The
method StructureImpl.ceate(...) detects that the object was already present
(deserialised from file at start up time and present in memory) and stops
processing (// 9 - We continue ..., line 523). 

If I change following lines, the folders are displayed correctly (probably
some more statements are missing):

        if (alreadyExists) {
	parentObject.addChild(courObject);    // new
            store(token, parentObject);                   // new
            throw new ObjectAlreadyExistsException(strUri);
        } 

By the way:

The stores for the new object created are committed within a transaction.
The parent object is changed (down to the store) but this change (children
add) is done outside a transaction and not committed.

Best regards

Juergen Pill


 <<Domain.xml>> 

Re: Multiple persistent stores

Posted by Remy Maucherat <re...@betaversion.org>.
Quoting "Pill, Juergen" <Ju...@softwareag.com>:

> Hello,
> 
> I have following scenario:
> 
> The uri "/"  is managed by the default MemoryStore
> The uri "/Patients" is managed by our self written TaminoStore. This
> TaminoStore serializes all the data and writes them to file at commit
> and
> read the serialized data at start up time. (please see attached
> domain.ini
> file for more details)

That's a problem when you mix non persistent stores with persistent ones. I 
don't handle that very well.

> I see now following problem:
> 
> The very first time slide starts up with out a problem, creating the
> "/Patients" folder (all the descriptors starting with /Patients are
> written
> to the serialized file). The second (and the next) start up of Slide do
> not
> display the Patients folder any more.
> This is caused by the method StructureImpl.ceate(...) called by
> XMLUnmarshaller.loadObjectNode(...). In line 177 (milestone4) the
> object
> declared in the xml file (/Patients) is created (structure.create). The
> method StructureImpl.ceate(...) detects that the object was already
> present
> (deserialised from file at start up time and present in memory) and
> stops
> processing (// 9 - We continue ..., line 523). 
> 
> If I change following lines, the folders are displayed correctly
> (probably
> some more statements are missing):
> 
>         if (alreadyExists) {
> 	parentObject.addChild(courObject);    // new
>             store(token, parentObject);                   // new
>             throw new ObjectAlreadyExistsException(strUri);
>         } 

That's clever. That would improve the robustness. I'll check if it doesn't 
break anything and add it.

> By the way:
> 
> The stores for the new object created are committed within a
> transaction.
> The parent object is changed (down to the store) but this change
> (children
> add) is done outside a transaction and not committed.

I changed quite a bit the whole transaction stuff (I followed your 
recomendations).
Is it a problem that I try doing stuff outside a transaction ?
I think the store should handle that.

Remy