I have a situation where I need to run a stored procedure (>5mins) and want my (silverlight) application to remain 'alive'
This I do with an async WCF Service for my UI thread to be responsive, at least until I request some data from the same DB again
Then, only after SP is finished the other request are executed
Can I somehow (in SQL I suppose) set the storedprocedure to be able to run alongside with other queries?
Thanks
edit:
- DB is on SQL Server
- starting SP from Linq2Sql model in
[OperationContract(AsyncPattern = true)]service method - other data is handled with WCF Ria Services (DomainService from Linq2SQL model, same connection string)
edit 2:
@dan1111: With testing I saw that until the point when WCF service returns result to Silverlight, DomainContext 'freezes'
Initially:
- I call WCF Async method with Thread.Sleep(15000)
- Application continues to work good
- When I go to a page where data is needed, I request DataContext.Load()
- DataContext.IsLoading becomes true
- I must wait the remaining of the 15seconds
- Now the completed event is fired for the previous DataContext.Load
Please tell me your opinion
Answer: 1
A very simple solution is to open more than one connection to the database. Each connection can do its own stuff.
However, there is another way to do it that actually sets up a procedure to run asynchronously:
http://rusanu.com/2009/08/05/asynchronous-procedure-execution/
by : dan1111http://stackoverflow.com/users/1584772
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog