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 jason harrop <jh...@bigpond.net.au> on 2000/12/02 03:31:06 UTC

MemoryStoreWithPersistence

Hi

I'm wondering about a variation on MemoryDescriptorsStore in which the
contents can be loaded from disk on initialize() or connect().

As per the comment already there, I'd use an entry in the parameters
hashtable to say where the serialisation files are.

I'm wondering about how/when to serialise.  I think there are 4
scenarios:

1.  On disconnect(), which happens when the relevant namespace is closed

2.  Force a serialisation. Assuming I'm not to access the store
directly, I guess this means each helper would need to tell the child
stores it cares about to serialise itself via commit() - the helpers
don't do this at the moment.  Or more simply, a new method in Namespace
which fires a commit() on each connectedService?

3.  Periodically eg every 15 minutes (timeInterval).  A simple way to do
this might be to use a field in MemoryStoreWithPersistence to record the
time of last serialisation.  Then when any of the create/put/store
methods are called (except maybe on lockStore), to check whether
timeInterval has elapsed.  If it has, then serialise, but before doing
so, we'd need to lock the entirety of each childStore.

4.  Triggered by the occurence of a certain number of transactions. 
Included here as a logical possibility only.

Does this make sense?

cheers,

Jason

Re: MemoryStoreWithPersistence

Posted by Remy Maucherat <re...@apache.org>.
> Hi
>
> I'm wondering about a variation on MemoryDescriptorsStore in which the
> contents can be loaded from disk on initialize() or connect().
>
> As per the comment already there, I'd use an entry in the parameters
> hashtable to say where the serialisation files are.
>
> I'm wondering about how/when to serialise.  I think there are 4
> scenarios:
>
> 1.  On disconnect(), which happens when the relevant namespace is closed
>
> 2.  Force a serialisation. Assuming I'm not to access the store
> directly, I guess this means each helper would need to tell the child
> stores it cares about to serialise itself via commit() - the helpers
> don't do this at the moment.  Or more simply, a new method in Namespace
> which fires a commit() on each connectedService?
>
> 3.  Periodically eg every 15 minutes (timeInterval).  A simple way to do
> this might be to use a field in MemoryStoreWithPersistence to record the
> time of last serialisation.  Then when any of the create/put/store
> methods are called (except maybe on lockStore), to check whether
> timeInterval has elapsed.  If it has, then serialise, but before doing
> so, we'd need to lock the entirety of each childStore.
>
> 4.  Triggered by the occurence of a certain number of transactions.
> Included here as a logical possibility only.
>
> Does this make sense?

Yes. It would be slow, but it will work. One problem would be that we have
to be really careful about how Slide is shutdown, but I guess there's no
workaround.

Remy