| Prasenjit 2006-10-06, 1:37 am |
| Hi,
Vinayak,
System is having one Base Catalog ,one Virtual Catalog which is derived from
the base catalog and 8 product categories and 8 product definitions.
We don't have any predefined catalog of products.Though type of products
i,e, say product definitions are fixed.
Ours is one line travel service provider site.
So product definitions are like Package,Flight,Hotel,Car Hire,Airport
Parking,Lounge etc.
Products are been added at runtime as the customer searches for a product.
So as a customer searches for flight in our site then the selected flight
information provided by third party supplier is been added to the catalog as
a product of type Flight using Catalog WebService.
Thus already the catalog is containing thousands, may be lakhs of products
with lots of variants.
Code snippets are like:
private CatalogServiceAgent catalogServiceAgent;
private CatalogContext catalogContext;
private BaseCatalog bc;
private VirtualCatalog vc;
webserviceurl=ConfigurationSettings.AppSettings["webserviceurl"].ToString();
catalogServiceAgent=new
CatalogServiceAgent(webserviceurl,Servic
eAgent.DefaultAuthMethods);
catalogContext= CatalogContext.Create(catalogServiceAgent,new
WebDebugContext(DebugMode.Checked));
bc=(BaseCatalog)catalogContext.GetCatalog("TravelCareCatalog","en-UK");
vc=(VirtualCatalog)catalogContext.GetCatalog("TravelCareVirtualCatalog","en-UK");
Microsoft.CatalogServer.Product
p=bc.CreateProduct("AirportLounge",AirportLoungeGUID.ToString()); p.AddParentCategory("AirportLoungeCategory");
p.AddVariant("1");
p.Variants.CatalogItems[0].DisplayName='dddd';
p.Variants.CatalogItems[0].ListPrice=20.00;
p.Variants.CatalogItems[0]["Name"]='aaaaaa';
p.Save();
vc.Rebuild(true);
Apart from product addition at runtime ,we are also updating a particular
products properties at runtime using catalog web service.So this means we are
accessing properties of a particular product using catalog web service and
then updating the properties.Code snippets are like:
webserviceurl=ConfigurationSettings.AppSettings["webserviceurl"].ToString();
catalogServiceAgent=new
CatalogServiceAgent(webserviceurl,Servic
eAgent.DefaultAuthMethods);
catalogContext= CatalogContext.Create(catalogServiceAgent,new
WebDebugContext(DebugMode.Checked));
bc=(BaseCatalog)catalogContext.GetCatalog("TravelCareCatalog","en-UK");
catalogProduct = bc.GetProduct(ProductGUID);
catalogProduct.Variants.CatalogItems[Convert.ToInt32(VariantID)-1][attributename]=attributevalue;
catalogProduct.Save();
vc.Rebuild(true);
Apart from this there are operations where a customers busket is being
accessed to find the products selected by the customer.Then the different
products kept as line items in particular orderform of the customers basket
are accessed from the catalog by using Commerce Servers general classes to
see different product properties.Code snippets are like:
Microsoft.CommerceServer.Runtime.Catalog.ProductCatalog catalog=
CommerceContext.Current.CatalogSystem.GetCatalog("TravelCareCatalog");
Microsoft.CommerceServer.Runtime.Catalog.Product prod =
catalog.GetProduct(ProductID);
DataTable dtPackage=prod.GetVariants().Tables[0];
for(int i=0;i<dtPackage.Rows.Count;i++)
{
if(dtPackage.Rows[i]["VariantID"].ToString()==SKU)
{
DataRow dr=dtpkg.NewRow();
dr["ProductGuid"]=ProductID;
dr["SKU"]=SKU;
dr["ProductType"]="Accommodation";
dr["Name"]=dtPackage.Rows[i]["Name"].ToString();
if(dtPackage.Rows[i]["AccomCheckInDate"].ToString().Length>0)
{
dr["CheckInDate"]=Convert.ToString( Convert.ToDateTime(
dtPackage.Rows[i]["AccomCheckInDate"].ToString()).Date).Replace("00:00:00","");
}
}
}
Here in the above code ,you can see we have not used catalog web service in
this case.
I found that there are lots of deadlock errors in event viewer for accessing
catalog
or while creating products or while saving product in catalog.
If you want anything else to know please let me know.
At peak hours in day time,lots of deadlock errors are occuring in all the
three web servers as visible in Event Viewer.As many as three to four
deadlock errors are visible in one minute in each of web server.
with regards,
Prasenjit
""Vinayak Tadas[MSFT]"" wrote:
> How amny items are there in the catalog?
> What operations are happening in the catalog system?
>
> Thanks
> Vinayak Tadas
> Microsoft
> http://blogs.msdn.com/vinayakt
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Get Secure! For more info visit http://www.microsoft.com/security. Please
> reply to the newsgroups only
>
>
> --------------------
> Thread-Topic: Catalog Web service exception in Network load balancing
> environmen
> thread-index: Acbnu9l0XaCgj50zQUaytw54KpPVuA==
> X-WBNR-Posting-Host: 217.33.9.79
> From: =?Utf-8?B?UHJhc2Vuaml0?= <Prasenjit@discussions.microsoft.com>
> Subject: Catalog Web service exception in Network load balancing environmen
> Date: Wed, 4 Oct 2006 06:49:01 -0700
> Lines: 91
> Message-ID: <3D17EED2-C96C-4110-97AE-A3B6AD0CE4E1@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
> Newsgroups: microsoft.public.commerceserver.general
> Path: TK2MSFTNGXA01.phx.gbl
> Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:18607
> NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
> X-Tomcat-NG: microsoft.public.commerceserver.general
>
> Hi,
> We are using Microsoft Commerce Server 2002 Enterprise edition with fp1
> and sp3.
> We are having e-coomerce site which is getting products from third party
> supplier on the fly when a customer searches for product in our web site.
>
> We are using catalog webservice coming with fp1 to add the product selected
> by the customer to the base catalog on the fly and then rebuilding the
> virtual catalog and then adding the product to the customer basket from
> virtual catalog.
>
> Things were fine in staging and testing servers,Windows Server 2003.
> But once we went live with three Network Load ballanced web servers hosting
> the web application pointing towards one Commerce Server application
> database kept in separate database server, problems crop up with the
> catalog
> web service.
>
> We edited Site Resource properties in Commerce Server Manager
> to map each CS Web Application in Load balanced servers to use same
> Commerce
> Server app database.This way three CS Web applications in the three Web
> servers were using same CS app database.
>
> We found in the first week of site's running ,problems with runtime product
> addition to CS catalog with catalog web service.
>
> We found that there were lots of entries in web servers' Event Viewer as
> following:
>
> An exception occurred in the 'CatalogWebService' Web service. Exception
> details follow:
>
> Microsoft.CatalogServer.CatalogDatabaseException: Could not create the
> variant. ---> System.Data.SqlClient.SqlException: Transaction (Process ID
> 310) was deadlocked on lock resources with another process and has been
> chosen as the deadlock victim. Rerun the transaction.
> at System.Data.SqlClient.SqlDataReader.Read()
> at System.Data.SqlClient.SqlDataReader.NextResult()
> at System.Data.Common.DbDataAdapter.FillNextResult(IDataReader
> dataReader)
> at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String
> srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords,
> DataColumn parentChapterColumn, Object parentChapterValue)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
> srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
> at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior)
> at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
> srcTable)
> at
> Microsoft.CatalogServer.Internal.SqlHelper.ExecuteDataset(SqlTransaction
> transaction, CommandType commandType, String commandText,
> CatalogDataSetType
> catalogDataSetType, SqlParameter[] commandParameters, String
> outParameterName, Object& outParameterValue)
> at
> Microsoft.CatalogServer.Internal.SqlHelper.ExecuteDataset(SqlTransaction
> transaction, String spName, CatalogDataSetType catalogDataSetType, Object[]
> parameterValues, String outParameterName, Object& outParameterValue)
> at
>
> Microsoft.CatalogServer.Internal.SqlHelper.ExecuteDataset(CatalogExecutionCo
> ntext
> catalogExecutionContext, String spName, Object[] parameterValues,
> CatalogDataSetType catalogDataSetType, String outParameterName, Object&
> outParameterValue)
> at
> Microsoft.CatalogServer.Internal.SqlHelper.ExecuteDataset(CatalogExecutionCo
> ntext
> catalogExecutionContext, String spName, CatalogDataSetType
> catalogDataSetType, Object[] parameterValues)
> at
> Microsoft.CatalogServer.Internal.Product.AddVariantToDatabase(CatalogItem
> catalogItem)
> --- End of inner exception stack trace ---
> at
> Microsoft.CatalogServer.Internal.Product.AddVariantToDatabase(CatalogItem
> catalogItem)
> at
> Microsoft.CatalogServer.Internal.Product.SetVariantProperties(CatalogItemsDa
> taSet updatedVariant)
> at Microsoft.CatalogServer.Internal.Product.Save(Boolean forceUpdate,
> Product updatedProduct)
> at
> Microsoft.CatalogServer.WebService.CatalogWebService.SaveProduct(Product
> updatedProduct, Boolean forceUpdate)
>
>
> We need immediate help on what could be causing the problem.Are there any
> configuration issues or designe faults in architechture ?
>
> regards
> Prasenjit Kr. Paul
> Software Engineer
> HCL Technologies,UK
>
|