internal bool Prepare()
{
/*if (TransactionInformation.Status == TransactionStatus.Aborted)
return false;
if (TransactionInformation.Status != TransactionStatus.Active)
throw new TransactionException("Cannot prepare transaction, as it is not active. Trasnaction Status: " + TransactionInformation.Status);
*/
bool booVoteToCommit = true;
PreparingEnlistment lpeEnlistment = null;
IEnlistmentNotification entNotification = null;
for (Int32 i = m_lstNotifications.Count - 1; i >= 0; i--)
{
entNotification = m_lstNotifications[i];
lpeEnlistment = new PreparingEnlistment();
entNotification.Prepare(lpeEnlistment);
if (lpeEnlistment.VoteToCommit.HasValue)
{
booVoteToCommit &= lpeEnlistment.VoteToCommit.Value;
if (lpeEnlistment.DoneProcessing)
m_lstNotifications.RemoveAt(i);
}
else
{
booVoteToCommit = false;
TransactionInformation.Status = TransactionStatus.InDoubt;
}
}
if (TransactionInformation.Status == TransactionStatus.InDoubt)
NotifyInDoubt();
return booVoteToCommit;
}