Considering the following code:
List<Processo> listaProcesso = new List<Processo>();
Processo processo;
processo = new Processo();
processo.AgendamentoID = 9;
processo.DataEntrada = DateTime.Now;
processo.EtapaExecucao = 0;
processo.RegistrosAfetados = 2;
listaProcesso.Add(processo);
processo = new Processo();
processo.AgendamentoID = 9;
processo.DataEntrada = DateTime.Now;
processo.EtapaExecucao = 0;
processo.RegistrosAfetados = 1;
listaProcesso.Add(processo);
using (TransactionScope ts = new TransactionScope())
{
using (SharedDbConnectionScope scs = new SharedDbConnectionScope())
{
foreach (Processo processoSave in listaProcesso)
{
processoSave.Save();
}
}
ts.Complete();
}
I can't see any error. But, when the save() is called for the second time, I receive a MySqlException: There is already an open DataReader associated with this Connection which must be closed first. Im am using Subsonic 3.0.0.3 and MySql.Data 6.0.4.0.
Thanks in advance.
Carlos Eduardo Appel Klein