W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 1997

Don't understand SimpleResourceStore

From: Anselm Baird_Smith <abaird@www43.inria.fr>
Date: Wed, 28 May 1997 15:53:38 +0200 (MET DST)
Message-Id: <199705281353.PAA02429@www43.inria.fr>
To: begall@nads.de
Cc: Jigsaw Mailing List <www-jigsaw@w3.org>

That's indeed correct, and I think it explains your problem: the old
index gets marked as modified, but as the store only sees the new one,
you get caught.

The fix is obvious:
    nresources.put(entry.identifier, entry) ;
should be:
    if ( entry.resource != null )
entry.resource.setValue("store-entry", entry);

I haven't compiled that yet, but it should work fine,

Thanks,
Anselm.

Christoph Begall writes:
 > Hi,
 >   I wrote a Resource that makes a new Resource and registers it to its
 > Parent-directory...  everything fine.
 >   As I want to be sure that all attributes of that new Resource are
 > saved properly to disk (I don't want to lose any data if jigsaw is
 > killed), I called something like
 >       getResourceStore().save()
 > in the Resource that registered the new Resource.
 >   This worked fine when I did it only once and killed the server: when
 > jigsaw was started again the resource was perfectly restored. Then I
 > did the same thing with more resources (calling save() every time)
 > I could only recover the first one correctly after killing the server.
 >   Then I digged through Jigsaw-src and ended up in SimpleResourceStore:
 > internalSave(boolean). There a new Hashtable nresources is made and
 > set to resources at the end. All ResourceIndex-objects in this
 > Hashtable are newly made, so they are not "synchronized" with the
 > ATTR_STORE_ENTRY-attribute of the resource: The store-entry will stay
 > old. Can that lead to the problem and is it a bug. (I don't really
 > think it is so, but I don't see the point.)
 > 
 > Thanks,
 > 	Christoph.
 > 
 > 
 > -- 
 > Christoph Begall                begall@NADS.de
 > NADS GmbH                       NADS - Advertising on Nets
 > Otto-Hahn-Str. 18               Tel.:  +49 231 975 123-0
 > D-44227 Dortmund                http://www.nads.de/
 > 
Received on Wednesday, 28 May 1997 09:54:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:26 GMT