}
} else {
for (int i = 0;i < resources.size();i++){
Resource r = (Resource)resources.elementAt(i);
try {
Vote v = r.prepare();
votes.setElementAt(v, i);
if (v.value() == Vote._VoteRollback){
rollback();
throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();
}
} catch(HeuristicHazard hh) {
throw new org.omg.CORBA.NO_IMPLEMENT();
} catch(HeuristicMixed hm) {
throw new org.omg.CORBA.NO_IMPLEMENT();
}
}
if (!move_to_state(Status._StatusPrepared)){
throw new org.omg.CORBA.INTERNAL();
}
if (!move_to_state(Status._StatusCommitting)){
throw new org.omg.CORBA.INTERNAL();
}
for (int i = 0;i < resources.size();i++){
Resource r = (Resource)resources.elementAt(i);
Vote v = (Vote)votes.elementAt(i);
try {
if (v == null){
throw new org.omg.CORBA.INTERNAL();
} else {
if (v.value() == Vote._VoteCommit){
r.commit();
}
}
} catch(NotPrepared np) {
throw new org.omg.CORBA.NO_IMPLEMENT();