1. Clear the cache before making the call. This is the simplest way. Use CPersistentBroker.ClearCache()
2. When you call the retrieve() method, set the useCache parameter to false. This will only force a reload of the current object though, and associated objects will still be retrieved from the cache if they are present. To force all objects to be refreshed from the database, but without clearing the cache first, you would need to override retrieve in your classes to manually load each of the associations without using the cache.
Option 1 is by far the easiest, and option 2 is a pain in the neck.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For option 1, the method is already there, just call it in your code.
Option 2 requires your own code. I'm not likely to change the framework to allow this behaviour in the near future since clearing the cache is the best and simlpest option in 99% of cases.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
How I can retrive an object with all relation, but without use cache. I need retrive in this form to multiuser environment (implements a reload).
There are a few options
1. Clear the cache before making the call. This is the simplest way. Use CPersistentBroker.ClearCache()
2. When you call the retrieve() method, set the useCache parameter to false. This will only force a reload of the current object though, and associated objects will still be retrieved from the cache if they are present. To force all objects to be refreshed from the database, but without clearing the cache first, you would need to override retrieve in your classes to manually load each of the associations without using the cache.
Option 1 is by far the easiest, and option 2 is a pain in the neck.
Hi.
You can create a method to do it ? or I can do it ?
For option 1, the method is already there, just call it in your code.
Option 2 requires your own code. I'm not likely to change the framework to allow this behaviour in the near future since clearing the cache is the best and simlpest option in 99% of cases.