The "Accessing IndexSearchContext after Commit() called" error might be thrown under heavy load with following stack trace:
ERROR Exception while getting Product for Part Number[TGA2501-GSG]
Exception: System.InvalidOperationException
Message: Accessing IndexSearchContext after Commit() called
Source: Sitecore.Kernel
at Sitecore.Search.IndexSearchContext.Search(PreparedQuery query)
at Sitecore.ItemBucket.Kernel.Util.IndexSearcher.RunQuery(Query query, Int32 pageSize, Int32 pageNumber, String sortField, String sortDirection)
at Sitecore.ItemBucket.Kernel.Util.IndexSearcher.RunQuery(Query query, Int32 pageSize, Int32 pageNumber)
at Sitecore.ItemBucket.Kernel.Util.IndexSearcher.GetItems(DateRangeSearchParam param)
at Sitecore.ItemBucket.Kernel.ItemExtensions.Axes.ItemExtensions.Search(Item itm, Int32& hitCount, String relatedIds, String indexName, String text, String templates, String location, String sortDirection, String language, String id, String sortField, String itemName, String startDate, String endDate, Int32 numberOfItemsToReturn, Int32 pageNumber)
at TriQuint.Web.Services.SitecoreServices.ProductDetailService.GetProductItem(String partNumber)
The reason of the error is in the Dispose() method of the Sitecore.ItemBucket.Kernel.Util.IndexSearcher class.
This method set static IndexSearcher.Index property to null, when another code try accessing it in not static method of the IndexSearcher class.
public virtual void Dispose()
{
Index = null;
}
To fix it you can remove/comment out this line in the Dispose() method.
The "Accessing IndexSearchContext after Commit() called" error might be thrown under heavy load with following stack trace: ERROR Exception while getting Product for Part Number[TGA2501-GSG] Exception: System.InvalidOperationException Message: Accessing IndexSearchContext after Commit() called Source: Sitecore.Kernel at Sitecore.Search.IndexSearchContext.Search(PreparedQuery query) at Sitecore.ItemBucket.Kernel.Util.IndexSearcher.RunQuery(Query query, Int32 pageSize, Int32 pageNumber, String sortField, String sortDirection) at Sitecore.ItemBucket.Kernel.Util.IndexSearcher.RunQuery(Query query, Int32 pageSize, Int32 pageNumber) at Sitecore.ItemBucket.Kernel.Util.IndexSearcher.GetItems(DateRangeSearchParam param) at Sitecore.ItemBucket.Kernel.ItemExtensions.Axes.ItemExtensions.Search(Item itm, Int32& hitCount, String relatedIds, String indexName, String text, String templates, String location, String sortDirection, String language, String id, String sortField, String itemName, String startDate, String endDate, Int32 numberOfItemsToReturn, Int32 pageNumber) at TriQuint.Web.Services.SitecoreServices.ProductDetailService.GetProductItem(String partNumber)
The reason of the error is in the Dispose() method of the Sitecore.ItemBucket.Kernel.Util.IndexSearcher class.
This method set static IndexSearcher.Index property to null, when another code try accessing it in not static method of the IndexSearcher class. public virtual void Dispose() { Index = null; }
To fix it you can remove/comment out this line in the Dispose() method.