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
|
I am playing with ls in a mvc application. I have 2 tables, Users and Claims. Each user can have a number of claims. I have 2 views in the apps. One shows all users and one shows the selected User.Claims If I alter the users in the database , and refresh the web app, the changes show up imediately. If I alter any of the claims, and refresh the app, the changes don't show. I can restart the web app, change users I am querying etc to no avail. The only way to see my changes is to wait several minutes, or restart the web server. If I change the assocation to eager load, it all works as I would expect. For what I am doing, I don't want the association to be cached, or eager loading. How can I stop this? Thanks
|
|
|
Hi Sean, That does sound peculiar. Lets see if we can identify the issue here. 1. How are you scoping your unit of work? Is it per request that you set it up? 2. Do you have any caching attributes on your controller actions (particularly under the claims actions)? 3. Could you try putting a DateTime.Now on the view of your claim page - does it change with each refresh? This is just a sanity check that there is no caching going on. 4. If your application is small, could you email it to me and I will test it out here (jd@mindscape.co.nz). We've had several asp.net mvc applications built on LightSpeed and not had these types of issues. The problem you seem to be experiencing reminds me mostly of when we built one application that heavily used output caching with ASP.NET where you would need to expire the cache when data had changed (or, if you were in dev mode, you could just run iisreset!). Hopefully this gives you some pointers for where to look for what's causing this situation. Let me know the answers to the questions so I can help some more :-) I hope that helps, John-Daniel Trask |
|
|
1 My application is based on your example app. Scopes etc are as in your app. ie _unitOfWorkScope = new PerRequestUnitOfWorkScope<CmsUnitOfWork>(MvcApplication.LightSpeedContext); 2 No caching attibutes set anywhere 3 DateTime changes as expected I may be able to do a sample app if you need it. I would need to create a smaller database etc so it could take some time.
|
|
|
Hi Sean, A small repro would be ideal, I can then dig in and get to the bottom of what's going on. If you could email it to my address listed above please and make sure that you don't zip up any binaries please :-) Thanks, John-Daniel Trask |
|
|
I think i have it sorted now. My UserRepository had a default contructor with a SimpleUnitOfWorkScope. Changing that to PerRequestUnitOfWorkScope sorted it. I am a bit confused, as the default constructor shouldn't be called, but it's working now.
|
|