TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rick
NA
3
0
Threading not working within Sharepoint Portal...
Aug 4 2006 7:26 PM
I am currently working on a large scale web-portal utilizing sharepoint written in ASP.net. I need to be able to start a new thread from one of my web-parts. That performs a lengthy process in which I pull records into a dataset and then create an Access DB that I insert the rows into. This process could take 2 - 15 minutes. My thread works fine within my development environment, however... when I post the code to my Sharepoint server as soon as the thread is executed it dies...
Is it possible to spawn a thread within a Sharepoint portal?
If so how?
Currently my code looks like this... Pretty basic... I've even tried passing credentials to the method that the thread. If anyone out there has done this I would greatly appreciate your insight. Thanks in advance...
private void CallingMethod()
{
ThreadStart tStart = new ThreadStart(ThreadExportData);
Thread thread = new Thread(tStart);
thread.Priority = ThreadPriority.BelowNormal;
thread.CurrentCulture = Thread.CurrentThread.CurrentCulture;
thread.Start();
}
private void ThreadExportData()
{
WindowsIdentity id = WindowsIdentity.GetCurrent();
id.Impersonate();
//Do work here..
id.Impersonate.Undo();
}
Reply
Answers (
1
)
Async Socket Sync Problem
Async operations with 2.0 framework