Hi all,
I have a question about transaction demarcation. To ensure that a long operation is correctly committed or rollbacked completely, I gave my starting method Propagation.REQUIRES_NEW and the methods called from it Propagation.MANDATORY.
One of these methods is a counter that is incremented (used to generate unique filenames). This part of the transaction should never be rollbacked, because then files are being overwritten. I tried to give this method Propagation.REQUIRES_NEW. That indeed starts a new transaction and suspends the current one. But I noticed if the "outer" transaction is rollbacked, the "inner" transaction will also be rollbacked.
Although I changed this code already to use a timestamp in the filename (which also makes it unique), I'd like to know if this would've been possible (and how of course).
Thanks, Jonne.
|