markSavedEntitiesAsFetched & Refetch

Posts   
 
    
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 21-Nov-2007 21:25:43   

Should a refetch occur when it is explicitly requested via the overloaded save even when markSavedEntitiesAsFetched is set to true?

E.G. Should the following result in a refetch?

adapter.SaveEntity(customerEntity, true)

Thanks for any feedback

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Nov-2007 05:23:56   

jshallard wrote:

Should a refetch occur when it is explicitly requested via the overloaded save even when markSavedEntitiesAsFetched is set to true?

E.G. Should the following result in a refetch?

adapter.SaveEntity(customerEntity, true)

Yes, that will result in a refetch coz you are explicity asking for that.

The flag you are referencing is used to set/no-set the OutOfSync status... in other words, the flag is useful when you are sure the saved entity doesn't need to be refetched.

Copied from Manual:

Flag (default: false) which controls if saved entities which aren't fetched back in the same call should be marked as Fetched instead of the default 'OutOfSync'. Setting this to true can save fetch roundtrips to the database to refetch data for the entity already in memory. However setting this setting to true can also cause getting the entity out of sync with the database because another thread has updated the same entity data. Use with care. It's recommended to leave it on its default value: false and only set this to true if you're sure the data in-memory reflects the entity data in the database.

David Elizondo | LLBLGen Support Team
jshallard
User
Posts: 62
Joined: 23-Mar-2005
# Posted on: 26-Nov-2007 15:31:47   

OK - thanks for the info.