The transaction processing system is very familiar to the database users, but if the transaction processing system is transferred from the database to the file system, it is estimated that many students will be helpless. In fact, support for file system operations transactions has been weak, regardless of library/framework, language, or file system level.
See some file system operations alone (such as file renaming, deletion, etc.), they are atomic, but from the current situation, there are few solutions to form a comprehensive set of APIs, all-round support for transactional file IO operations. If file operations (such as creating, modifying, renaming, deleting files) need to be executed consistently as part of a transaction, the application often has to rely on a self-designed scenario to reduce the likelihood of a system/application failure or inconsistent state when concurrent access occurs.
There is no particularly good way to manage the transactional management of file systems, although Apache also offers some methods, but in practice it is not very convenient and effective.
APACHE provide the file thing system,
please refer to the blog:http://blog.csdn.net/ffm83/article/details/42235771
In many of the daily work, encountered this problem, is to take the first backup, and then modify the way to deal with, the big deal use multiple copies, or use pessimistic lock, or use optimistic lock, and then combined with the business form of targeted processing.
A good memory is better than a bad pen. 26-java Handling file transactions (4)