This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Dear all, I have noticed that if my application is idel for 15-20, my connection of lightspeed context is lost. Do anyone has any idea so that I can set timeout duration to get rid of the problem? Following is my code which gets or set the lightspeed context:
Thanks in advance, Kaushal Sharma |
|
|
correction.. ideal for 15-20 minutes ;) |
|
|
I believe you should have a look at using a custom connection strategy where you can handle reconnecting as required - there is an example in this thread: http://www.mindscapehq.com/forums/thread/3061#10020 Let us know if that isn't going to cover what you are looking to achieve though.
|
|
|
Thanks Jeremy, I'll have a look to the link. Kaushal |
|
|
I have created a connection strategy class which is being used while creating UOWs.
Following is the code to create UOW:
But now whenever I want to access the UOW (like example below), I am getting the error "Cannot access a disposed object. Object name: 'BaseModelUnitOfWork". I dont know what is going wrong in above code. Please help.
Kaushal Sharma |
|
|
The UnitOfWork implements IDisposable so the code you have here:
Is implicitly calling Dispose() on _context when the using scope completes. This causes the UnitOfWork to mark itself as complete which causes the exception when you try and use it later on. Try this instead:
|
|
|
Thanks Jeremy, Your suggestion worked straight away. Just one question, I have experienced that using custom connection strategy the response of webservices is little bit slower than the normal default connection strategy. Is this true? I need to check whether the connection is being timed out or not but I want to express my thank to you. Kaushal Sharma |
|
|
Problem for connection timeout is still not solve even after using connection strategy. I had left application ideal for 45 minutes and when I tried to use the application, connection was lost. Any ideas now?? Thanks, Kaushal Sharma |
|
|
Have you debugged into your connection strategy to see that your code is being called as expected? If you can send through a small repro project I can try and have a look at this here for you if that would be of use.
|
|