Rogelio wrote:
Frans,
Why the cache is not enable by default?
What are the cons if I enable it in a remoting scenario (multiple user)?
It's thread safe, though does that with a lock, so it can be a little slower (can, doesn't have to). It's not enabled by default because it eats memory
Does the FetchEntity creates PersitenceInfo object?
yes, every query created creates the buckets.
Does the SaveEntityCollection implements some kind of cache for the PersistenceInfo object that it need to create?
No, it's created every time. As the bucket is just very small, not a lot of cycles are spend there, compared to the cycles spend on the roundtrip to the db.
In v2, this changes though: every field in an entity has a static part and a dynamic part. The static part is shared among all instances of that field: name, type etc. The value of the field is dynamic. Persistence info is also shared among all fields, so no more factories to produce it, it's cached in a readonly cache at startup, so it's much faster to create entities and save entities and also entities have a much much lower memory footprint.