Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jta-dev] OK to suspend() if marked for rollback?

I hope this is a sensible question. I'm addressing it to this list rather than (say) narayana-users because it concerns the jakarta.transaction.TransactionManager interface. (I saw no "jta-users" list.)

Suppose TransactionManager#begin() is called on the current thread.

Suppose next TransactionManager#setRollbackOnly() is called on the same thread. Obviously now ultimately this transaction's outcome can only be rollback.

Suppose next TransactionManager#suspend() is called on the same thread.

Is this a legal call? Can you suspend a transaction that is marked for rollback?

Assuming you can, then assume a new transaction is started and committed. (I assume that's possible?)

Suppose next TransactionManager#resume(...) is called with the Transaction representing the suspended-and-marked-for-rollback transaction.

Are we still in a legal state? (I understand this transaction's only outcome will be rollback.) Or was there an illegal state in there somewhere? I…guess it's OK to do suspension and resumption even when you know everything is going to ultimately blow up? Or…?

Best,
Laird



Back to the top