[Skinscript] unable to update property
Hi Steve, I ran into a very tricky problem when developing a site with emarket. Here is the structure of my site: root |--acl_users(Membership product) |--emarket |--shoppers The acl_users is an instance of Membership product, which is as a specialist as shoppers, and they both have a WebIC_MemberClass zclass as their rack object class. The difference is that, acl_users stores WebIC_MemberClass persistently, while shoppers just reflects that storage. Here is the skinscript for shopper's rack: WITH acl_users.getItem(self.id) COMPUTE oo=RESULT WITH self.oo COMPUTE email, transCount WHEN OBJECT CHANGED STORE transCount USING self.oo.propertysheets.webic.manage_changeProperties(transCount=self.transCount) When emarket trying to increment a shopper's transCount, I ran into a "ZODB.POSException.ConflictError". The following is the traceback: Traceback (innermost last): File C:\WebSite\lib\python\ZPublisher\Publish.py, line 222, in publish_module File C:\WebSite\lib\python\ZPublisher\Publish.py, line 199, in publish File C:\WebSite\lib\python\ZPublisher\Publish.py, line 199, in publish File C:\WebSite\lib\python\ZPublisher\Publish.py, line 199, in publish File C:\WebSite\lib\python\ZPublisher\Publish.py, line 195, in publish File C:\WebSite\lib\python\Zope\__init__.py, line 188, in zpublisher_exception_hook (Object: ProviderContainer) File C:\WebSite\lib\python\ZPublisher\Publish.py, line 175, in publish File C:\WebSite\lib\python\Zope\__init__.py, line 235, in commit File C:\WebSite\lib\python\ZODB\Transaction.py, line 251, in commit File C:\WebSite\lib\python\ZODB\Connection.py, line 351, in commit (Info: (('*hdVMVCvgk/wIgJaYf/nkEA==', 'WebIC_MemberClass'), '\000\000\000\000\000\000d\357', '')) File C:\WebSite\lib\python\ZODB\FileStorage.py, line 664, in store (Object: C:\WebSite/var/Data.fs) ConflictError: ('\0039\323C4=\266\210', '\0039\323B\375\036\270U') Is it something wrong with my skinscript? cheers Dirksen __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Hi Dirksen, I think that WHEN OBJECT CHANGED is used when some code tries to change a DataSkin attribute and you need to update some external source. So... an appropriate thing to do would be to call an SQL method, or talk to another Specalist which needs to be notified .. etc. I think that you may be 'double' chaning... e.g., some code tries to change the transaction count... this fires a trigger that *also* tries to change the same thing... hence the conflic error. Can you share the code that is firing the trigger? (TransCount is used to keep track of the shopper's 'current' transaction. In the current implementation It is used to calculate a 'basked id' since each shopper can have mulitiple baskets, as they return for more shopping later.. ) TransCount should only be modified when a shopper completes a transaction and they need a 'new' basket. Does that help? -steve
"Dirksen" == Dirksen <dirksen_lau@yahoo.com> writes:
Dirksen> Hi Steve, Dirksen> I ran into a very tricky problem when developing a site Dirksen> with emarket. Here is the structure of my site: Dirksen> root |--acl_users(Membership product) |--emarket Dirksen> |--shoppers Dirksen> The acl_users is an instance of Membership product, which Dirksen> is as a specialist as shoppers, and they both have a Dirksen> WebIC_MemberClass zclass as their rack object class. The Dirksen> difference is that, acl_users stores WebIC_MemberClass Dirksen> persistently, while shoppers just reflects that Dirksen> storage. Here is the skinscript for shopper's rack: Dirksen> WITH acl_users.getItem(self.id) COMPUTE oo=RESULT Dirksen> WITH self.oo COMPUTE email, transCount Dirksen> WHEN OBJECT CHANGED STORE transCount USING Dirksen> self.oo.propertysheets.webic.manage_changeProperties(transCount=self.transCount) Dirksen> When emarket trying to increment a shopper's transCount, Dirksen> I ran into a "ZODB.POSException.ConflictError". The Dirksen> following is the traceback: Traceback (innermost last): Dirksen> File C:\WebSite\lib\python\ZPublisher\Publish.py, line Dirksen> 222, in publish_module File Dirksen> C:\WebSite\lib\python\ZPublisher\Publish.py, line 199, in Dirksen> publish File C:\WebSite\lib\python\ZPublisher\Publish.py, Dirksen> line 199, in publish File Dirksen> C:\WebSite\lib\python\ZPublisher\Publish.py, line 199, in Dirksen> publish File C:\WebSite\lib\python\ZPublisher\Publish.py, Dirksen> line 195, in publish File Dirksen> C:\WebSite\lib\python\Zope\__init__.py, line 188, in Dirksen> zpublisher_exception_hook (Object: ProviderContainer) Dirksen> File C:\WebSite\lib\python\ZPublisher\Publish.py, line Dirksen> 175, in publish File Dirksen> C:\WebSite\lib\python\Zope\__init__.py, line 235, in Dirksen> commit File C:\WebSite\lib\python\ZODB\Transaction.py, Dirksen> line 251, in commit File Dirksen> C:\WebSite\lib\python\ZODB\Connection.py, line 351, in Dirksen> commit (Info: (('*hdVMVCvgk/wIgJaYf/nkEA==', Dirksen> 'WebIC_MemberClass'), '\000\000\000\000\000\000d\357', Dirksen> '')) File C:\WebSite\lib\python\ZODB\FileStorage.py, line Dirksen> 664, in store (Object: C:\WebSite/var/Data.fs) Dirksen> ConflictError: ('\0039\323C4=\266\210', Dirksen> '\0039\323B\375\036\270U') Dirksen> Is it something wrong with my skinscript? Dirksen> cheers Dirksen Dirksen> __________________________________________________ Do You Dirksen> Yahoo!? Get email at your own domain with Yahoo! Mail. Dirksen> http://personal.mail.yahoo.com/
participants (2)
-
Dirksen -
Steve Spicklemire