"In addition, there may be power losses that do not stop the application, so any solution should have a permanent cache that can withstand power cycles."
You already have a Hibernate Layer 2 cache solution. But you did not say what the real requirements are. You have an unrealized network. This is normal; you have an unrealized power supply. It's also good. What level of service do you want to achieve? What is acceptable or not?
Is data loss possible? How much could you take? What risk do you take?
To be more explicit, let's say you have a local replica of the database, or at least part of it. Let's say you know how to make changes to the queue / save made locally. Say you save a thesis modification on your hard drive to be safe in the event of a power failure. Let's say you can merge the changes with the main database when the connection is again available.
This is already a lot of assumptions. OK, but what happens if one hard drive fails after a power failure? Do you know that a hard drive does not like a power failure and may be damaged by a power failure or may even be damaged?
So, you put on RAID and add uninterruptible power supply. It's good. You detect an OS power failure event. Complete the current transaction and exit correctly. You RAID protect you from disk failure.
OK, but what happens if the whole computer stops functioning? What happens in case of fire? Or water damage? All disks will be managed, data cannot be restored and is not synchronized with the central database. Is this acceptable or not?
Even when Wi-Fi is turned on, the power supply works fine ... What is the reliability of the central database? Do you have regular backups? Or a cluster solution? Are you sure your central database is reliable anyway?
From a database perspective, it is easy to use a cluster or backup and use transactions to ensure data consistency. You can still lose data (if you do not use the cluster in particular), but you can restore it to the last backup.
But if you want to work offline (with an inaccessible database), and you are not the only one who can change the database, there will be conflicts. This is no longer a cache, sleep mode, or something technical.
This is a functional issue. What if several changes happen offline and you need to merge? What is acceptable? What is not. Perhaps this is due to the fact that when you reconnect, the latest changes are applied, old changes are discarded. Ptential conflicts are detected and it is suggested that the user handle them. You can try to apply the change in the queue and apply all of them ...
I would like to think that you can offer "offline mode", but your users should know that they are offline, and should be notified when changes become permanent in the central database with possible conflict resolution. But this is my point of view.