It depends a little how you use the JPA support in Transaction Control. If you use it in a non-dynamic way then there’s not much we can do, but the easiest (and recommended) ways to use Transaction control handle this by relying on the JPA service to do the right thing.
When using the JPA service the bundle containing the entity classes also contains the persistence.xml and is called the “persistence bundle”. When this bundle is started the JPA service will create an EMF for it and register it in the service registry. When this bundle is stopped the JPA service will unregister the EMF. When the bundle is unresolved/uninstalled the JPA service will close/discard the EMF.
In this model - if the cache is defined in the persistence unit, then it will be automatically recreated when the EMF is recreated and there is no risk of invalid entries. If the cache is defined outside the persistence unit then it must be more carefully managed by the person providing it, however this should happen automatically if they are listening for the EMF services being created.
As for Transaction Control, all of this fits with the normal service lifecycle. Services should be discarded by consumers when the services are unregistered, which includes the Transaction Control Resource Providers as well as the Transaction Control service itself.
I hope this helps.
Tim