How to manage the transaction(which includes File IO) when an IOException is thrown from the close file method
问题 I've recently begun using Spring's Data Source Transaction Manager. I have a problem now. My transaction includes updates to a DB table and a write operation to a file. It works fine but I have some doubts about file I/O. As you see below, I have configured openFile and closeFile methods of my bean as the init-method and the destroy-method respectively, which in turn provides those methods to be called just like a constuructor and a destructor. If the file is not closed properly, some of the