Frans,
Adapter, v1.0.2004.2 (sorry for using this version, will be using 1.0.2005 soon):
I am processing 5000 records from one table. I read all the records inside a TypedList, then I process each record and create two entities from each record and insert them to the DataBase. I am having memory problems, I would like to reuse the two entities object that I am inserting, that is create only one instance for each entity. I can insert the two entities for the first record; but when I try to insert the entities for the second one I get an error of FKConstrains that the field in entity2 that related it with entity1 can not be null. The two entities are related. The entity1.entity1Pk field is an identity column.
The code is something like this:
entity1: entity1Pk is identity column and primary key
entity1.fields.State = Fetched
entity1.propertyxxx = yyyyyy
entity1.Isnew = True
entity2: entity1Pk is the field that related this entity with entity1
entity2.fields.State = Fetched
entity2.entity1 = entity1
entity2.propertyxxx = yyyy
entity2.Isnew = True
For the first record it works; but for the second the field entity2.entity1Pk is not being set after the entity1 is saved. I thing the problem is with the collection that entity1 has to keep track of entity2, I will check it.