If someone completed the transactional letter to a file, please help me.
A related topic was discussed in an earlier thread ( transactional record ).
The use case is as follows:
if writing to the log file failed, cancel the corresponding DB transaction.
Thus, the recording file must be executed in a transactional manner.
I chose Apache Commons Transaction lib.
And there is a problem that does not allow me to go further, because I did not find the relevant documentation or examples.
I created an instance of FileResourceManager:
FileResourceManager frm = new FileResourceManager ("C: \ cur", "c: \ cur", true, logger);
As I understand from this Apache Commons Transaction tutorial , I have to follow these steps:
start a transaction:
frm.start();
get transaction ID for it:
transactionId = frm.generatedUniqueTxId();
call method, which is necessary, for example. writeResource with transactionId and resourceId:
frm.writeResource(transactionId, resourceId);
And here is the ambiguity:
a) how can I connect resourceId to a real resource, what should I write transactioanally?
b) how will my file, which I will write transactionally, now be near resourceId ?
Thanks for the tips.
java file apache-commons transactional
sergionni
source share