Find - possible problem
I am building a Kettle tranform to load species & breed data from a csv file. As part of the testing, I ran the transform to load the 3 species, then used Administration|Lookups to check the data loaded. Humm error - all set to Default, so I deleted the 3 species, fixed my code, and re-ran the transform.
Then I pressed the Find button - however the 3 species which should have re-appeared did not. Humm - tried logging off and on again - still not there.
Clutching at straws, I changed the Active pulldown from Yes to Both, and clicked Find - ahah - the expected 3 species appeared - and they were active.
I think that what is happening is that the OpenVPMS code is caching the data - and hence, because it has seen no updates (because I am updating via Kettle), it uses the cached results and thus does not see the 3 species that Kettle loaded. Changing Active from yes to Both forces it to re-do the database access and hence the 3 species added by Kettle appear.
I do not think that we need to change anything in the code - we need to keep as much caching as possible. Howevever, implementors/developers need to understand that this caching is present, and that if you change the database externally to the OpenVPMS code (eg using Kettle or SQL) then you may not see the changes you expect. Logging off & on again is not enough, you really need a Tomcat restart to flush all the caches.
Regards, Tim G
Re: Find - possible problem
There are multiple caches within OpenVPMS.
In general, if you update the database outside OpenVPMS, the changes:
The major caches are listed below:
1. Hibernate's second level cache, configured by ehcache.xml
Elements in this cache are set with the flag eternal="true", which means that they don't expire unless the cache capacity is reached, in which case the least recently used will be tossed out.
2. Archetypes
Elements in this cache can only be updated by:
3. Lookups
Elements in this cache can be updated:
4. Appointments/tasks
Elements in this cache can be updated:
5. Current user context
This includes the current:
Refreshed by: