Thanks for reply,
But i did not know where and when this error will generated.
i have a page, in almost every time all things are ok, but in production server that more than 150 users are online, this error was generated.
also not all errors of this type generated at this page.
below is code:
Code:
if (String.IsNullOrEmpty(StoryId))
return;
if (ClearCache)
Cache.Remove(StoryId);
item = NoCacheUse ? null : Cache.Get(StoryId) as ContentEntity;
if (item == null) {
[b]item = ContentBusinessLayer.Instance.Load(StoryId);[/b]
if (item == null)
return;
Cache.Add(item.Id, item, null, DateTime.Now.AddMinutes(10), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Normal, null);
}
// some times error generated here from a proxy
TopTitle.InnerHtml = item.TopTitle;
TopTitle.Visible = true;
IconImage.ImageUrl = item.Icon;
IconImage.Visible = true;
ContentTitle.InnerHtml = item.Title;
ContentTitle.Visible = true;
SubTitle.InnerHtml = item.SubTitle;
SubTitle.Visible = true;
ContentLead.InnerHtml = item.Lead;
ContentLead.Visible = true;
ContentBody.InnerHtml = item.Body;
ContentBody.Visible = true;
Page.Title = item.PageTitle;
PublishTimeLabel.Text = item.PublishTime;
// and some times error generated here
LabelsPanel.Visible = item.Labels.Count>0;
if (LabelsPanel.Visible) {
LabelsRepeater.DataSource = item.Labels;
LabelsRepeater.DataBind();
}
Helper.SetKeywords(Page.Header, item.Keywords);
Helper.SetDescription(Page.Header, item.Description);
if (SourcePanel.Visible) {
SourceHyperLink.Text = item.SourceName;
SourceHyperLink.NavigateUrl = item.SourceUrl;
}
but please note:
1. almost everything is ok
2. in pages other than above this error may be generated (i put this just as sample)
3. i simplify the code, line that i try to blod, i.e. "ContentBusinessLayer" is loader function.
below is hbm of entity:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Mehan.Navand.EntityLayer.ContentManagement" assembly="Mehan.Navand.EntityLayer">
<class name="ContentEntity" table="OrmCms_ContentsTable" select-before-update="true" dynamic-update="true" optimistic-lock="none">
<id name="Id" type="string" unsaved-value="null">
<generator class="uuid.hex" />
</id>
<version name="Version" unsaved-value="-1"/>
<property name="CreationDate" type="datetime"/>
<property name="DisplayIcon" />
<property name="Icon" />
<property name="DisplayTopTitle" />
<property name="TopTitle" />
<property name="DisplaySubTitle" />
<property name="SubTitle" />
<property name="Body" type="StringClob" />
<property name="Title" />
<property name="DisplayTitle" />
<property name="Lead" type="StringClob" />
<property name="DisplayLead" />
<property name="PageTitle" />
<property name="ChangePageTitle" />
<property name="Layout" />
<property name="Url" />
<property name="DisplayLabels" />
<property name="DisplayRelatedContents" />
<property name="DisplaySourceLink" />
<property name="SourceName" />
<property name="SourceUrl" />
<property name="ContentType" />
<property name="Comment" />
<property name="Description" />
<property name="UseDescription" />
<property name="Culture" />
<property name="IsPermanent" />
<property name="Importance" />
<property name="DisplayLastModified" />
<property name="LastModified" type="datetime" />
<property name="PublishTime" type="datetime" />
<property name="VisitedCount" type="int" />
<property name="DisplayLinkers" />
<many-to-one name="Creator" column="CreatorId" class="Mehan.Navand.EntityLayer.MemberEntity" not-null="true"/>
<bag name="Labels" table="OrmCms_ContentLabelsTable">
<key column="ContentId"/>
<element column="Label" type="string"/>
</bag>
<bag name="Keywords" table="OrmCms_ContentKeywordsTable">
<key column="ContentId"/>
<element column="Keyword" type="string"/>
</bag>
<bag name="RelatedContents" table="OrmCms_ContentRelatedContentsTable" lazy="true">
<key column="ContentId"/>
<many-to-many class="ContentEntity" column="RelatedContentId"/>
</bag>
</class>
</hibernate-mapping>