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



Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
What does the exception say in English?
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
Sorry...

"This SqlTransaction was concluded; it cannot more used being."

Rogério Mauri Smile



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
P.S.

In the detail of the error the reference is for ' roollback'. However, the error already occurs in the call ' commit' (inside of the 'try' block). In the example I captured the message presented for the StrataFrame in the call to ' roollback' , in the 'catch' block. I wait that you have understood. Smile

Rogério Mauri Smile



ChanKK
ChanKK
StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)StrataFrame User (414 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

I am having exactly the same error message as you posted.

However, in my case, I found that it is NOT the actual error. The actual cause is an error occurred during BO.Save(true); the transaction.Connection is somehow become null.



Then, same as your code, I have exception catch and TransactionRollback() is called. As transaction.Connection is null, TransactionRollback() will throw SqlTransaction has completed and can not be used.



Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
So you are saying that when you call the TransactionCommit you are getting the error, correct?  Are you using the Enterprise Server?  What database are you using?
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
Trent L. Taylor (05/06/2009)
So you are saying that when you call the TransactionCommit you are getting the error, correct?  

Yes!

Platform of development
- Windows Server 2008
- SQL Server 2008 (Standard Edition or/and Express)
- Visual Studio 2008 (Professional Edition)
- .NET Framework 3.5 SP1
- StrataFrame 1.6.7

Platform of the user of the program
- Windows XP/200x
- .NET Framework 3.5 SP1
- SQL Server 2005/2008 (Standard or Express)

Before, it functioned perfectly. After to modify the environment of development for VS2008 (.NET Framework 3.5 SP1) with SQL2008 the problem appeared, as much in the environment of development as in the production environment.


Rogério Mauri Smile



Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Rogerio,

Is it possible for you to write a simple WinForms sample that reproduces this error?  We are doing this very thing and not having any issues.  So there must be something else within your environment that is not being introduced into our test.  Thanks.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
OK, there is no need to post a sample.  We found what was going on.  I have just posted a new build that will correct this issue.  If you are not using SPROCS for inserts and updates the reader was getting closed.  If you load the new update this issue should be taken care of.  Sorry for any trouble!
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
Ok... Thank you!!! Very much...

Tongue Wink

Rogério Mauri Smile



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search