| Author |
Message |
Guest
|
Posted:
Mon Aug 22, 2005 4:52 pm Post subject:
[ASP.NET] Support for transactions when updating products da |
|
|
Hi all,
We are writing an ASP.NET application using Commerce Server 2002 SP3 on
Windows 2000.
We want to add transaction support to our C# data manipulation code,
that serially creates/updates several CS objets (mostly products
information).
We want to avoid a situation where only part of an update series would
be successful, leading to an "intermediate state" in the database.
We do not find reference to ADO.NET -like transaction abilities of the
Commerce Server API objets & methods.
Is there away to achieve such a mecanism ?
Thanks in advance,
AMS |
|
| Back to top |
|
 |
Vinayak Tadas[MSFT]
Guest
|
Posted:
Mon Aug 22, 2005 8:52 pm Post subject:
RE: [ASP.NET] Support for transactions when updating product |
|
|
Are you trying to update the product information in the catalogs as a part
of a transaction?
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
--------------------
From: ams8764@netscape.net
Newsgroups: microsoft.public.commerceserver.general
Subject: [ASP.NET] Support for transactions when updating products data ?
Date: 22 Aug 2005 09:44:15 -0700
Organization: http://groups.google.com
Lines: 20
Message-ID: <1124729055.811038.33750@z14g2000cwz.googlegroups.com>
NNTP-Posting-Host: 62.23.237.17
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1124729061 20750 127.0.0.1 (22 Aug 2005
16:44:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 22 Aug 2005 16:44:21 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=62.23.237.17;
posting-account=PZ8s3Q0AAAAmg38VabALoICeANiC6nY1
Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.maxwell.syr.edu!postnews.google.com!z14g2000cwz.
googlegroups.com!not-for-mail
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3259
X-Tomcat-NG: microsoft.public.commerceserver.general
Hi all,
We are writing an ASP.NET application using Commerce Server 2002 SP3 on
Windows 2000.
We want to add transaction support to our C# data manipulation code,
that serially creates/updates several CS objets (mostly products
information).
We want to avoid a situation where only part of an update series would
be successful, leading to an "intermediate state" in the database.
We do not find reference to ADO.NET -like transaction abilities of the
Commerce Server API objets & methods.
Is there away to achieve such a mecanism ?
Thanks in advance,
AMS |
|
| Back to top |
|
 |
Guest
|
Posted:
Tue Aug 23, 2005 8:52 am Post subject:
Re: Support for transactions when updating products data ? |
|
|
Let me give you an example...
Our business goal is to manage products that are associated to
categories and linked to other products.
We want to do something like this for a single product.
UpdateProductProperties(pid)
RemoveProductCategories(pid)
AddProductCategory(pid,cat)
RemoveProductRelationships(pid)
AddProductRelationship(pid,pid2)
We want to have it running in the context of a single transaction so
that we always have a consistent state if the execution gets broken in
the middle of the operations.
Methods have the following pseudo code
using Microsoft.CommerceServer.Interop.Catalog.Product;
UpdateProductProperties(productID)
{
CatalogManager cm = new CatalogManager();
cm.Initialize(...);
ProductCatalog productCatalog = cm.GetCatalog(...);
product = productCatalog.GetProduct( productID );
ADODB._Recordset rs = product.GetProductProperties;
// setting properties...
product.SetProductProperties(rs, false);
}
RemoveProductCategories(productID)
{
CatalogManager cm = new CatalogManager();
cm.Initialize(...);
ProductCatalog productCatalog = cm.GetCatalog(...);
product = productCatalog.GetProduct( productID );
ADODB._Recordset rs = product.ParentCategories;
...
category = productCatalog.GetCategory(...);
category.RemoveProduct(productId)
...
}
AddProductRelationShip(productId1,productId2)
{
CatalogManager cm = new CatalogManager();
cm.Initialize(...);
ProductCatalog prodCatalog = cm.GetCatalog(...);
Product product = prodCatalog.GetProduct(productId1);
product.AddRelationshipToProduct(productId2,...);
}
etc ...
We do not know if bundling all Commerce Server access is a single
function (thus mutualizing a single CatalogManager object) would help,
but it would break our granular approach to data updates.
Any CS built in mecanism that could allow me to do this ?
AMS |
|
| Back to top |
|
 |
Vinayak Tadas[MSFT]
Guest
|
Posted:
Tue Aug 23, 2005 8:53 pm Post subject:
Re: Support for transactions when updating products data ? |
|
|
The catalog system does not support nested transactions since some of these
operations that you mentioned manipulate fulltext indexes.
Manipulation of fulltext indexes is not allowed as a part of a transaction.
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
--------------------
From: ams8764@netscape.net
Newsgroups: microsoft.public.commerceserver.general
Subject: Re: Support for transactions when updating products data ?
Date: 23 Aug 2005 01:09:21 -0700
Organization: http://groups.google.com
Lines: 65
Message-ID: <1124784561.684399.232100@g49g2000cwa.googlegroups.com>
References: <1124729055.811038.33750@z14g2000cwz.googlegroups.com>
<TeDJLx0pFHA.340@TK2MSFTNGXA01.phx.gbl>
NNTP-Posting-Host: 62.23.237.17
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1124784567 19284 127.0.0.1 (23 Aug 2005
08:09:27 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 23 Aug 2005 08:09:27 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: g49g2000cwa.googlegroups.com; posting-host=62.23.237.17;
posting-account=PZ8s3Q0AAAAmg38VabALoICeANiC6nY1
Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!g49g2000cwa.googlegroups.com!not-fo
r-mail
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3265
X-Tomcat-NG: microsoft.public.commerceserver.general
Let me give you an example...
Our business goal is to manage products that are associated to
categories and linked to other products.
We want to do something like this for a single product.
UpdateProductProperties(pid)
RemoveProductCategories(pid)
AddProductCategory(pid,cat)
RemoveProductRelationships(pid)
AddProductRelationship(pid,pid2)
We want to have it running in the context of a single transaction so
that we always have a consistent state if the execution gets broken in
the middle of the operations.
Methods have the following pseudo code
using Microsoft.CommerceServer.Interop.Catalog.Product;
UpdateProductProperties(productID)
{
CatalogManager cm = new CatalogManager();
cm.Initialize(...);
ProductCatalog productCatalog = cm.GetCatalog(...);
product = productCatalog.GetProduct( productID );
ADODB._Recordset rs = product.GetProductProperties;
// setting properties...
product.SetProductProperties(rs, false);
}
RemoveProductCategories(productID)
{
CatalogManager cm = new CatalogManager();
cm.Initialize(...);
ProductCatalog productCatalog = cm.GetCatalog(...);
product = productCatalog.GetProduct( productID );
ADODB._Recordset rs = product.ParentCategories;
...
category = productCatalog.GetCategory(...);
category.RemoveProduct(productId)
...
}
AddProductRelationShip(productId1,productId2)
{
CatalogManager cm = new CatalogManager();
cm.Initialize(...);
ProductCatalog prodCatalog = cm.GetCatalog(...);
Product product = prodCatalog.GetProduct(productId1);
product.AddRelationshipToProduct(productId2,...);
}
etc ...
We do not know if bundling all Commerce Server access is a single
function (thus mutualizing a single CatalogManager object) would help,
but it would break our granular approach to data updates.
Any CS built in mecanism that could allow me to do this ?
AMS |
|
| Back to top |
|
 |
Guest
|
Posted:
Wed Aug 24, 2005 12:52 pm Post subject:
Re: Support for transactions when updating products data ? |
|
|
| Thanks a lot ! |
|
| Back to top |
|
 |
|
|
|
|