TheSwamp

Code Red => .NET => Topic started by: Tasaq on February 11, 2015, 11:17:10 AM

Title: Transaction stack overflow exception
Post by: Tasaq on February 11, 2015, 11:17:10 AM
Hi,

I have some function in my project that run when project is loaded.

As the title says I've run into stack overflow exception with transactions, this happens instantly after loadng project in block edit mode or when this project was created in AutoCAD Architexture. To be precise, stack overflow occurs when transaction ends (call to Abort or Commit).

Did someone run into this before, any ideas why Transaction can cause stack overflow?
Title: Re: Transaction stack overflow exception
Post by: MexicanCustard on February 11, 2015, 01:22:32 PM
Would really help to see some code and/or the exact exception, stackoverflow is pretty generic.  My first guess is that your transaction has gone out of scope, i.e. you've committed, aborted, or disposed of it somewhere else in your code.
Title: Re: Transaction stack overflow exception
Post by: Tasaq on February 11, 2015, 03:47:04 PM
StackOverflowException was unhandled. An unhandled exception of type 'System.StackOverflowException' occurred in AcdbMgd.dll. This is all the info I can get.

Keep in mind that the code runs fine with standard AutoCAD projects. Another hint is that this occurs with nested transactions (but I am not sure if this is always the case).

As for code, I am under NDA so I can't show it in public, it would reveal to much.
Title: Re: Transaction stack overflow exception
Post by: Jeff H on February 12, 2015, 02:30:42 PM
With information given about all I can tell you is maybe your recursively calling method, an event triggering itself, catching exception and calling method on instance that caused it, etc.....................
Title: Re: Transaction stack overflow exception
Post by: CADbloke on February 12, 2015, 06:38:07 PM
this occurs with nested transactions (but I am not sure if this is always the case).
How many transactions have you created? There is a limit. Also, Debug.WriteLine() is your friend.

I'm with @Jeff, sounds like a recursion problem...again.