Hi there,
we are facing a problem with some entities we want to load only once on start. We are using LLBLgen 4.2.15 with adapter.
I try to make it clear:
We have a lot tables in db which contains "system-data" e.g. paymenttypes, countries or shoptype.
Because we need these entities a lot of times in our application, we only want to load these entities at startup.
We also have entities which have a foreign-key to this entities. Lets say: OrderHeader has a countryid and a paymenttypeid field.
Now, because we dont now exactly if we need the country when working with orderheader we fetch it without prefetchpath.
So, if the user want to do any work on the header entity, we set the foreignkey entities on demand, like this:
If pHeader.Country Is Nothing Then
pHeader.Country= GlobalCache.Get(Of SystemCountryEntity)()(pHeader.CountryId.Value)
End If
On first call after application start everything works fine. Now the user load the header entity once again, because something changed in db and/or he wants to do the function again.
Now, the code above dont work and the pHeader.Country is nothing after setting it. It seems that the CountryEntity has a collection auf HeaderEntities and thinks, that nothing changed, so nothing has to be done.
So:
Is it possible to load/set the CountryEntity so it can added multiple times to the HeaderEntity?
Hopefully I could make it clear what I want to do and there is a solution for that.
Regards
Torsten