Transactions Error: DEF_TRANS_KEY has not been started


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Here is my code:

private void UpdateAspireForTransfer()
{
    try
    {
       
BusinessLayer.TransactionBegin("Aspire", IsolationLevel.ReadCommitted);
       
// Retrieve the next Batch ID
       
String mBatchID = GetNextBatchID();
        AssignBatchID(mBatchID);
        CreateCommissions(mBatchID);
       
BusinessLayer.TransactionCommit("Aspire");
        UpdateDynamicsForTransfer(mBatchID);
    }
    catch
    {
       
BusinessLayer.TransactionRollback("Aspire");
       
throw;
    }
}

For some reason, yet unknown to me, the TransactionRollBack gets called and generates an error:

A transaction with the key [DEF_TRANS_KEY] has not been started.

and this stack trace:

at MicroFour.StrataFrame.Data.DbDataSourceItem.TransactionEnd(String TransactionKey, Boolean IsCommit)
at MicroFour.StrataFrame.Data.DbDataSourceItem.TransactionRollback(String TransactionKey)
at MicroFour.StrataFrame.Business.BusinessLayer.TransactionRollback(String DataSourceKey)
at Aspire.Accounting.Invoicing.UpdateAspireForTransfer()
at Aspire.Accounting.Invoicing.TransferTSB_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

So, what am I doing wrong?

Thanks, for straightening me out,
Bill


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 16 Years Ago
Bill Cunnien - 16 Years Ago
Bill Cunnien - 16 Years Ago
StrataFrame Team - 16 Years Ago
Bill Cunnien - 16 Years Ago
                         Still not working. A transaction with the key [DEF_TRANS_KEY] has not...
Bill Cunnien - 16 Years Ago
                             I am removing transactions within the code. This would be a perfect...
Bill Cunnien - 16 Years Ago
                                 Transactions are a commonly used portion of the framework, but the one...
Trent L. Taylor - 16 Years Ago
                                     Ok, now that Edhy helped me solve an underlying issue with the primary...
Bill Cunnien - 16 Years Ago
                                         As I am re-working the transaction thingy, I was wondering, can one...
Bill Cunnien - 16 Years Ago
                                             The docs are a little ambiguous on this issue (see Using Transactional...
Bill Cunnien - 16 Years Ago
Bill Cunnien - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search