When I browse blog, I see last post twice but one record in database.

Topics: Business Logic Layer
May 30, 2009 at 9:59 AM

When I browse blog, I see last post twice but one record in database.

it only happen I restart IIS, then I post article by windows live writer.

I guess it's because that Post.cs
  protected override void DataInsert()
  {
   BlogService.InsertPost(this);

   if (this.IsNew)
   {
    Posts.Add(this);

    
1. iis restart, Posts is static collection and not inited.
2. BlogService.InsertPost(this); //data into db.
3. Posts.Add(this); //when asp.net touch Posts, asp.net begin init it. it will load all posts include last post.
     //then .Add(this) make duplicate.
 

Jan 12, 2010 at 2:49 PM

I want to add that i'm having the same issue with my blog.  When I add a post from Windows Live Writer, it shows up twice.  I've only seen the issue with the first post after I change the code on the website or touch Web.config

Mar 2, 2013 at 9:02 PM
I'm still seeing this issue .. BE 2.7 on Server 2008/IIS 7.5.
Apr 29, 2013 at 2:37 PM
I had the same issue (I think) - with the variation that once one of the duplicate posts was considered draft and the other published. IIS 8.0.

I'll investigate some more