Quick search:

How to make sure objects get refreshed when the database is modified

The easiest way to make sure all objects will be refreshed is start a new http request. This can be done by redirecting the browser. ObjectSaveAction and ObjectDeleteAction do this after changes have been saved to the database.

If you do not want to start a new http request it is useful to know that the PntDbClassDescriptor instances cache already loaded peanuts and will never return copies of already loaded peanuts though any of the getPeanuts methods. So if you make sure to create no copies yourself and refresh already cashed objects everything should be consistent with the database - with respect to changes made in the same request.

The standard persistency does not offer any locking to prevent or resolve inconsistencies resulting from changes to the database made by other http requests or other software that connects to the same database. It you need that kind of locking, you should be aware that the time the data you want to lock spends in a HTML form in the browser of a user is probably a lot longer then the time it spends in objects during the processing of a http request. Therfore locking should probably include both objects and HTML forms.