Re: TimeStamp LAG in editing context
Jonathan Rochkind <[email protected]> Thu, 06 Mar 2003 10:14:12 -0600
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
[Un-cross-posted from multiple groups; following up just to eof list]. At 10:31 AM 3/6/2003 -0300, Ing.Gaston Blanco wrote: >I´m setting the lag in the editing context to 1 , then i create an EC, >fetch an object. Then, from a sql terminal i change it, and when i refetch >the changes are not reflected in my object. I believed that if the lag was >to small the snapshot would be refreshed, and my object updated, but this >didn´t happened. Well, here's a stab at explaining what's going on. The 'lag' you've set refers to seconds (or ms, I forget, but time) _before the creation_ of the EOEditingContext. If you've set it to 1 second, that means that EC will make sure not to use snapshots OLDER than 1 second BEFORE the EC was CREATED. So changes that occured AFTER the EC was created----these don't disturb the EC's commitment to not using snapshots older than 1 second before it was created. Now you could constantly reset the EOEditingContext's fetchTimestamp(). Note that the static method is called default timestamp LAG and means that each EC, upon creation, will have it's timestamp set to that much time earlier. But the instance method that applies to a particular EOEditingContext is called setFetchTimestamp(), and takes an NSTimestamp point-in-time---it's not a lag, it's an actual point-in-time, and the EC will refuse to accept snapshots prior to this point in time. So you could be constantly resetting this fetchTimestamp to be just a few seconds before NOW. I'm not sure what effect this will have---it could be deleterious on efficiency, as in-memory EOs are constantly refetched because they're snapshots are no good. Alternately, it might not even do what you want: I suspect it only effects _fetches_, it won't effect EOs in memory, possibly unless you refetch those EOs. But you say you are doing a refetch, so it might have the consequences you want. In fact, this might be a very good idea, but I'm not really sure, it makes me a little bit nervous. Alternately, you always have available to you: setting refreshesRefetchedObjects to true on a particular EOFetchSpecification. This means, regardless of the timestamp on the EC, when you do this fetch, take the fresh values from the db and use them to create a new snapshot. It applies to just that one fetch spec, and the timestamp set on the EC doesn't matter at all. Hope this helps, --Jonathan >Any clue????? > >thanks > > >Ing. Gaston Blanco >__________________________________________________ > >Todavía no tenés tu Ciudad Internet Mail? Obtenelo ahora! - >http://webmail.ciudad.com.ar > >Descargá Gratis el nuevo Internet Explorer 6.0, el mejor software para >actualizar tu PC. >http://www.ciudad.com.ar/ar/servicios/ie/ > >_______________________________________________ >EOF mailing list >[email protected] >http://www.omnigroup.com/mailman/listinfo/eof