This is a mirror of official site: http://jasper-net.blogspot.com/

ASP.NET (MVC) and the Tale of the Continuous Application Restarts

| Monday, December 13, 2010
I made a classic rookie mistake with ASP.NET (MVC) the other day. In my spare time, I’m working on this small sample application for myself in order to learn more about ASP.NET MVC. After working on this small web application for a while, I came to the point where I needed to set up a database for persisting some data. I just wanted to get this out of the way as quickly as possible, so I used Fluent NHibernate’s schema generation to quickly set up a SQLite database. Everything worked splendid so far.

But when I did some manual tests by using the web application for entering some data and storing it in the database, I started to notice some strange behaviors. Particularly, after the application managed to successfully store a record in the database, the next thing when it tried to read it back out again, the record was gone. After checking the code involved, I tried to debug this a couple of times. Although the transaction completed successfully, and the record became visible in the database (I used SQLite Administrator for that), the next thing I knew, the record disappeared again.

At first I thought it had something to do with the transaction. I’ve had some issues with transactions and SQLite in the past, but I was quickly able to root this out. After doing some more digging and debugging I found the actual reason for this strange behavior.

Read more: <elegantc*de>

Posted via email from .NET Info

0 comments: