SaveMulti Question

Posts   
 
    
ChrisMoses
User
Posts: 18
Joined: 22-Feb-2005
# Posted on: 07-Aug-2005 09:05:03   

Hi, I have a few questions about SaveMulti with SelfService code:

It looks like there was once a problem with this:

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=794

I.e - SaveMulti did not walk the entire tree and save dirty or added items.

A hotfix was mentioned.

Questions: 1. has this been fixed in some/all of the shipping templates?

  1. If not, is this hotfix availalable to people evaluating LLBLGen? I really like it so dar, but not being able to save or update anything would be a problem with the evaluation.

  2. If it hasn't been fixed, or isn't available, are there any workarounds other than walking the entire tree?

THanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Aug-2005 10:02:53   

ChrisMoses wrote:

Hi, I have a few questions about SaveMulti with SelfService code:

It looks like there was once a problem with this:

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=794

I.e - SaveMulti did not walk the entire tree and save dirty or added items.

A hotfix was mentioned.

Questions: 1. has this been fixed in some/all of the shipping templates?

Hotfixes are staying hotfixes for a week or so, then they're rolled into the final installer and that installer is then updated. Both demo version and final version are always kept up to date. So if you 're downloading the demo version, you get the final latest build.

  1. If not, is this hotfix availalable to people evaluating LLBLGen? I really like it so dar, but not being able to save or update anything would be a problem with the evaluation.

You should be able to do that, if not please post on the forum a question about it. The demo download page has a date mentioned when the installer was last updated, and the demo version itself has a date in the about box when it was last updated. You should have definitely the hotfix you linked to in the version you're using.

  1. If it hasn't been fixed, or isn't available, are there any workarounds other than walking the entire tree?

two types of saves are available: 1) just save the object or objects Save or SaveMulti() was called on 2) save the objects Save or SaveMulti() was called on AND recurse to save the complete graph in the right order (so if you have 3 new customer entities and their new order objects in each customer.Orders collection, you first want to have customer saved, then order, ).

entity.Save(true); performs a recursive save from entity to all its referenced objects in memory. This is very fast. It checks if a related entity in memory is 'dirty' as well, if not, it doesn't save that entity. entityCollection.SaveMulti(true); performs a recursive save on all entities in the entityCollection object.

entity.Save() just saves the entity, not related entities as well. entityCollection.SaveMulti() just saves the entities in the entitycollection, not related entities.

Only dirty/new entities are saved, all recursive saves are done in the right order, that's why it has to traverse the complete graph (though that's very fast) in memory.

Please also see the reference manual in the LLBLGen Pro demo folder on your harddisk for more information about a method simple_smile

Frans Bouma | Lead developer LLBLGen Pro