Transaction Error


Author
Message
Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
After update for VS2008 and SQL2008, the operations with transaction present the error below.

public void TesteTransacao()
{
    using (NCClubeBO.TbClubeBO loBO = new NCClubeBO.TbClubeBO())
    {
 loBO.FillAll();

 try
 {
     MicroFour.StrataFrame.Business.BusinessLayer.TransactionBegin("", System.Data.IsolationLevel.ReadCommitted);
     if (loBO.Count > 0)
     {
        if (loBO.MoveFirst())
        {
           do
           {
              loBO.Edit(false);
              loBO.NomeClube = loBO.NomeClube;
           } while (loBO.MoveNext());
        }
     }
     loBO.Save(true);
     MicroFour.StrataFrame.Business.BusinessLayer.TransactionCommit("");
     System.Windows.Forms.MessageBox.Show("OK");
 }
 catch(Exception err)
 {
     MicroFour.StrataFrame.Business.BusinessLayer.TransactionRollback("");
     System.Windows.Forms.MessageBox.Show(err.Message);
 }
    }
}

InvalidOperationException
  Este SqlTransaction foi concluído; ele não pode mais ser usado.

Source     : System.Data

Stack Trace:
   em System.Data.SqlClient.SqlTransaction.ZombieCheck()
   em System.Data.SqlClient.SqlTransaction.Rollback()
   em MicroFour.StrataFrame.Data.DbDataSourceItem.TransactionEnd(String TransactionKey, Boolean IsCommit)
   em MicroFour.StrataFrame.Data.DbDataSourceItem.TransactionRollback(String TransactionKey)
   em MicroFour.StrataFrame.Data.DataLayer.TransactionRollback(String DataSourceKey, String TransactionKey)
   em MicroFour.StrataFrame.Business.BusinessLayer.TransactionRollback(String DataSourceKey)
   em NCClube.OtherClass.Class1.TesteTransacao() na C:\Users\Administrador\Documents\Visual Studio 2008\Projects\StrataFrameProjects\NCClube\NCClube\OtherClass\Class1.cs:linha 36
   em NCClube.FormMain.cmdTbClube_Click(Object sender, EventArgs e) na C:\Users\Administrador\Documents\Visual Studio 2008\Projects\StrataFrameProjects\NCClube\NCClube\FormMain.cs:linha 64
   em System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   em System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   em System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   em System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   em System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   em System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   em System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   em System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   em System.Windows.Forms.Control.WndProc(Message& m)
   em System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   em System.Windows.Forms.ToolStrip.WndProc(Message& m)
   em System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   em System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
   em System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
   em System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Rogério Mauri Smile



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Rogerio Mauri - 15 Years Ago
Trent L. Taylor - 15 Years Ago
Rogerio Mauri - 15 Years Ago
Rogerio Mauri - 15 Years Ago
                     Hi,
I am having exactly the same error message as you posted....
ChanKK - 15 Years Ago
                         So you are saying that when you call the TransactionCommit you are...
Trent L. Taylor - 15 Years Ago
                             [quote][b]Trent L. Taylor (05/06/2009)[/b][hr]So you are saying that...
Rogerio Mauri - 15 Years Ago
                                 Rogerio, Is it possible for you to write a simple WinForms sample...
Trent L. Taylor - 15 Years Ago
                                     OK, there is no need to post a sample. We found what was going on. I...
Trent L. Taylor - 15 Years Ago
                                         Ok... Thank you!!! Very much... :P ;)
Rogerio Mauri - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search