"ejb3workshop" wrote : But then it wouldn't be atomic, nor consistent or
durable. What happens in this case if 3 should fail and the transaction has to be rolled
back ?
|
Actually it is all three of those, and you missed the I (Isolated) ;)
In a 2pc protocol, all participants have already voted ok to prepare() by the time commit
is called on them by the transaction manager.
If 3) fails then depending on why it failed, the transaction manager will kick int he
recovery protocol, and retry calling commit on it until it eventually commits.
In some cases a "heuristic" outcome may be required - i.e. manually intervention
to commit the branch.
But voting ok to prepare basically means "I have all the data I need to commit"
so in principle I can commit.
As I say, this is all standard XA/JTA, nothing new here.
I'd suggest a look at the XA spec (it's not a fun read), but you can probably
google and find lots of resources about 2PC, also recovery protocols.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157796#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...