I am debug my application.
I notice that return to execute query. I do not deal because it does not recover of the cache. When execute you consult without I specify it. I do not deal because it does not recover of cache in certain cases and returns to execute the consultation
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not quite sure what is being asked here but I think you want to know if a CRetrieveCriteria always hits the database?
The short answer is Yes. The reason being that there is no guarantee that new information hasn't been added by another user. If we just hit the cache the results could be incorrect.
If you want to know if you can do a CRetrieveCriteria against just the cached objects? At this stage you can't - I've thought about it but I'm not sure if it's a good feature or not.
- Richard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A onetomany B, in the database i have one object A with five object B. Now, the asscociation is retriveautomatic=false. When I access to collection of the objects B, i execute a RetriveCriteria. I supose that object A and objects B is in the cache.
Now, I retrive object A, the framework retrive of the cache, but when I access to property of the collection then the property count is equal to 0, the framework execute again retriveCriteria. I don't understand why the object A doesn't have the collection in the cache.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The cache is designed to be non-volatile (ie it won't change unless you do a save/delete operation).
If you retrieve object A without automatic retrieve the cache will contain a copy of object A without any B objects.
Changing object A in your code (by accessing the BCollection property) doesn't affect the A object in the cache, it only affects your working copy of the object.
If you retrieve A again (without first updating the cache) then you will get the copy of A from the cache, which is the original versionm, without any objects in the collection.
In your A.BCollection property add the following line after you have populated the collection
getPersistenceBrokerInstance.addToCache(me)
This should update the cache and the next time you retrieve the object you should get A with the B collection populated.
I hope that is fairly clear to you.
- Richard.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I am debug my application.
I notice that return to execute query. I do not deal because it does not recover of the cache. When execute you consult without I specify it. I do not deal because it does not recover of cache in certain cases and returns to execute the consultation
Query of collection always is executed???
Hi Victor,
I'm not quite sure what is being asked here but I think you want to know if a CRetrieveCriteria always hits the database?
The short answer is Yes. The reason being that there is no guarantee that new information hasn't been added by another user. If we just hit the cache the results could be incorrect.
If you want to know if you can do a CRetrieveCriteria against just the cached objects? At this stage you can't - I've thought about it but I'm not sure if it's a good feature or not.
- Richard
my problem is that: I have a following structure
A onetomany B, in the database i have one object A with five object B. Now, the asscociation is retriveautomatic=false. When I access to collection of the objects B, i execute a RetriveCriteria. I supose that object A and objects B is in the cache.
Now, I retrive object A, the framework retrive of the cache, but when I access to property of the collection then the property count is equal to 0, the framework execute again retriveCriteria. I don't understand why the object A doesn't have the collection in the cache.
Hi Victor
The cache is designed to be non-volatile (ie it won't change unless you do a save/delete operation).
If you retrieve object A without automatic retrieve the cache will contain a copy of object A without any B objects.
Changing object A in your code (by accessing the BCollection property) doesn't affect the A object in the cache, it only affects your working copy of the object.
If you retrieve A again (without first updating the cache) then you will get the copy of A from the cache, which is the original versionm, without any objects in the collection.
In your A.BCollection property add the following line after you have populated the collection
getPersistenceBrokerInstance.addToCache(me)
This should update the cache and the next time you retrieve the object you should get A with the B collection populated.
I hope that is fairly clear to you.
- Richard.
Thank you, it is correct.