I have a CMP for a small database table that contains pretty static data. I would like for the CMP to make a single access to the database to load all of the rows in the table into cache. Once the data has been loaded, I would like the CMP to be completely independent of the database; such that if the database fails or changes, the CMP will never 'know', but instead, it will continue to return the cached data. I have tried commit-option A, read-only, etc., but to no avail. Is this situation not appropriate to a CMP? Will lost connections always cause Exceptions? Any and all input on this subject would be appreciated.
Instances will be reloaded in the next transaction after they are passivated.
You can try
in this case instances will be held in memory and never passivated. If you are not afraid of OutOfMemoryError this is the best option.