I feel its intuitive to declare the ehcache decorators as well in the XML itself so that I can completely centralize all my configuration at one place itself.
In this part of the article about caching we'll discuss using Eh Cache for a different purpose other than as Hibernate second level cache.
Eh Cache offers the class Self Populating Cache that extends Blocking Cache class.
Let's modify this example to use Eh Cache instead of the static variable. From the cache manager we can get a reference of an already existing cache, or add a new cache. We can still have the cache configuration for hibernate and in the same It would be nice that the cache knows how to populate itself and get around the first problem of having to populate it at the beginning of the application.
Since it would be an Eh Cache type of cache, it would have the properties of the cache configured in the file, and we are especially interested in the expiration property if we want to refresh this cache at some interval.
Note that a nonstop instance can go into nonstop mode even if the client is not disconnected, such as when an operation is unable to complete within the timeout allotted by the nonstop configuration.
In addition, nonstop instances running in a client that is unable to locate the TSA at startup will initiate nonstop behavior as if the client had disconnected. Use cases include: to prevent timeouts for most of the interruptions.