thread abort exception when service ends to where it has been invoked from
-
hy everyone! we do have a problem: we coded a webpart which allows searching and printing of document in a document store. you search for files, you are able to display them and you are able to print them. therefor we wrote a printservice, which fetches the file from the store and sends them to the spooler and printer respectively. that works fine. afterwords we update the database to set some fields, indicating the file was already printed. when using a little amount of files it works file, but the bigger the collection of file is, the more problems appear. meaning, when selecting around 100 files with around 1 MB each, a thread abort exception is thrown. if there are just 40 files, no exception is thrown. and to complicate the situation: if you repeat printing the same files lets say for 10 times, it works in lets say 7 tries and fails in 3 tries. sometimes it even works in all tries or it fails more often. its like guessing numbers in a lottery. but it does not throw the thrad abort exception during printing, it throws the exception when returning to the code of the webpart where the printing was invoked at. meaning we wrote a printbuttonclick event-function which invokes the printservice with the file ids, and some other properties. and when returning the exception is thrown. we tried to change the timeout of the printservice indefinite (-1), we also tried to change the code to get as much performance as possible, we also did a lot of garbage collection etc. but we can't get rid of this exception. we also have already been googling for this incident, but nothing really solved our problem. we were just able to send more files until it is likely to be thrown. printing around 100 files could take up to 1-2 minutes, so i guess maybe this could take to long and the thread times out when returning. does anyone have an idea of 1) where to start to get an idea how to get rid of this error (maybe a page of hints we haven't already been to etc.) 2) how to get rid of this exception. maybe one of you has already encountered anything similar. thanks for any hints and ideas. if you do need some further infos for understanding or to get an idea of how to solve it, just feel free to ask. thanks! stephan.
-
hy everyone! we do have a problem: we coded a webpart which allows searching and printing of document in a document store. you search for files, you are able to display them and you are able to print them. therefor we wrote a printservice, which fetches the file from the store and sends them to the spooler and printer respectively. that works fine. afterwords we update the database to set some fields, indicating the file was already printed. when using a little amount of files it works file, but the bigger the collection of file is, the more problems appear. meaning, when selecting around 100 files with around 1 MB each, a thread abort exception is thrown. if there are just 40 files, no exception is thrown. and to complicate the situation: if you repeat printing the same files lets say for 10 times, it works in lets say 7 tries and fails in 3 tries. sometimes it even works in all tries or it fails more often. its like guessing numbers in a lottery. but it does not throw the thrad abort exception during printing, it throws the exception when returning to the code of the webpart where the printing was invoked at. meaning we wrote a printbuttonclick event-function which invokes the printservice with the file ids, and some other properties. and when returning the exception is thrown. we tried to change the timeout of the printservice indefinite (-1), we also tried to change the code to get as much performance as possible, we also did a lot of garbage collection etc. but we can't get rid of this exception. we also have already been googling for this incident, but nothing really solved our problem. we were just able to send more files until it is likely to be thrown. printing around 100 files could take up to 1-2 minutes, so i guess maybe this could take to long and the thread times out when returning. does anyone have an idea of 1) where to start to get an idea how to get rid of this error (maybe a page of hints we haven't already been to etc.) 2) how to get rid of this exception. maybe one of you has already encountered anything similar. thanks for any hints and ideas. if you do need some further infos for understanding or to get an idea of how to solve it, just feel free to ask. thanks! stephan.
The only thing that the ThreadAbortException is used for, is aborting threads. That is done by calling the Abort method of a Thread, which then throws the exception in the thread in order to abort it. So, are you aborting any thread?
Despite everything, the person most likely to be fooling you next is yourself.
-
The only thing that the ThreadAbortException is used for, is aborting threads. That is done by calling the Abort method of a Thread, which then throws the exception in the thread in order to abort it. So, are you aborting any thread?
Despite everything, the person most likely to be fooling you next is yourself.
nope, i am not aborting any thread. i forgot to add an important info: sharepoint is located on two servers, meaning there is a loadbalancing installed using two servers. could it be, the task is switched to the other server when returning? meaning when starting the printing from server A to sharepoint it looks like as if the server is very busy and when returning it is switched to server B, but there is not thread active so it thinks it is aborted? that's an idea which I had when talking to some other guys.