ThreadAbortException: Thread was aborted exception???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher D. Wiederspan

    #1

    ThreadAbortException: Thread was aborted exception???

    I've got a WebServices application that uses Crystal Reports to produce and
    then export Invoices to PDF format. Without getting into too many details,
    it's just a big loop statement that goes out to SQL using a SqlDataAdapter,
    brings back a dataset which is pushed into the Crystal Report, and the
    report is exported - nothing fancy.



    Everything works great in that on my development machine, I can run through
    2,000 reports without hitting any snags. But when we deploy and try to run
    the WebService on a production machine, it throws out a
    ThreadAbortExce ptions at random times. The exception does not get raised at
    one particular line of code or at any predicable interval within the loop -
    it's very random, although it's almost always thrown once within the first
    15 reports, and then the remaining 1,875 or so run without raising the
    exception again.



    The only significant difference that I can point to between my development
    machine and the production machine is that the production machine is a
    dual-processor Xeon, while my dev machine is a lowly single processor -
    could that have anything to do with it? Please know too that my code does
    nothing with threads - I just run one long process in the existing thread.
    It seems that the Exception is either being thrown from the Crystal Engine,
    or from the SqlClient library as it retrieves the data - and actually I've
    seen evidence that it's throwing from both.



    In any case, if anybody has any ideas on this, please let me know.



    Thanks,

    Chris


  • Alvin Bruney

    #2
    Re: ThreadAbortExce ption: Thread was aborted exception???

    Are you redirecting or transfering from one page to another? That gets
    executed on another thread. Thread Abort exceptions 'cant be caught'. You
    can catch them but the CLR immediately rethrows it.

    You've violated a rule of thumbs here. If you are developing for a dual
    processor, you absolutely must test on a dual processor to catch concurrency
    and synchronization issues.

    If this is not possible (and it often is not due to company beaurocracy),
    you need to remote attach the debugger to the server process. MSDN tells you
    how to do this. Then set your exceptions (off of the debug menu) to break
    into the debugger on CLR exceptions.

    Fire the application up. When the thread exception occurs it will stop at
    the offending line. If it is coming from a module that you don't have soure
    code for, you are out of luck.

    hth
    "Christophe r D. Wiederspan" <wiederspan@net quote.com> wrote in message
    news:#0L#yM7SDH A.2120@TK2MSFTN GP11.phx.gbl...[color=blue]
    > I've got a WebServices application that uses Crystal Reports to produce[/color]
    and[color=blue]
    > then export Invoices to PDF format. Without getting into too many details,
    > it's just a big loop statement that goes out to SQL using a[/color]
    SqlDataAdapter,[color=blue]
    > brings back a dataset which is pushed into the Crystal Report, and the
    > report is exported - nothing fancy.
    >
    >
    >
    > Everything works great in that on my development machine, I can run[/color]
    through[color=blue]
    > 2,000 reports without hitting any snags. But when we deploy and try to run
    > the WebService on a production machine, it throws out a
    > ThreadAbortExce ptions at random times. The exception does not get raised[/color]
    at[color=blue]
    > one particular line of code or at any predicable interval within the[/color]
    loop -[color=blue]
    > it's very random, although it's almost always thrown once within the first
    > 15 reports, and then the remaining 1,875 or so run without raising the
    > exception again.
    >
    >
    >
    > The only significant difference that I can point to between my development
    > machine and the production machine is that the production machine is a
    > dual-processor Xeon, while my dev machine is a lowly single processor -
    > could that have anything to do with it? Please know too that my code does
    > nothing with threads - I just run one long process in the existing thread.
    > It seems that the Exception is either being thrown from the Crystal[/color]
    Engine,[color=blue]
    > or from the SqlClient library as it retrieves the data - and actually I've
    > seen evidence that it's throwing from both.
    >
    >
    >
    > In any case, if anybody has any ideas on this, please let me know.
    >
    >
    >
    > Thanks,
    >
    > Chris
    >
    >[/color]


    Comment

    Working...