[Grok-dev] Re: STORM howto

Christian Klinger cklinger at novareto.de
Fri Mar 14 09:32:41 EDT 2008


Christian Klinger schrieb:
> Hi Sebastian,
> 
> 
> in nva/stormcontainer/container.py there is a method called
> 
>     def __setitem__(self, name, item):
>         store = getUtility(IZStorm).get(self.getStoreUtilityName())
>         store.add(item)
>         #transaction.commit()
> 
> just comment out the #transaction.commit()
> 
> The tests pass with no errors. I have to ask on storm mailing list
> if this is ok without transaction.commit .
> 

I have discussed this with Gustavo Niemeyer on irc.
Zope is responsible for committing if the request succeeded. So it´s ok
not to use transaction.commit().

I will fix this in a new release.

Christian

> I´m working on a new release for the stormcontainer maybe this is also
> a issue for it.
> 
> HTH Christian
> 
> 
>> Excellent. Let me know how and when I can test this update :)
>>
>> Mvh Sebastian
>>
>> 14 mar 2008 kl. 10.29 skrev Christian Klinger:
>>
>>>>> The transaction.commit() fires also an rdb.commit. This means on 
>>>>> every insert there is a commit.
>>>>>
>>>>> But maybe it is possible to delete the transaction.commit() in 
>>>>> __setitem__, and rely on zopes transaction.commit.?
>>>> I do not think any library or framework should ever do a commit itself.
>>>> You should hook properly into the zope transaction manager. Any
>>>> premature commit can result in inconsistent or erroneous data in your
>>>> database. And reducing the number of commits will have a huge impact on
>>>> performance.
>>>
>>> Hi Wichert,
>>>
>>> thx for this info. I will delete the transaction.commit() run the 
>>> tests. and see if it works again... :-))
>>>
>>> Christian
>>>
>>>> Wichert.



More information about the Grok-dev mailing list