incubator-bloodhound-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olemis Lang <ole...@gmail.com>
Subject Re: Datamodel and data consistency
Date Thu, 25 Oct 2012 18:57:13 GMT
On 10/25/12, Peter Koželj <peter@digiverse.si> wrote:
> On Thu, Oct 25, 2012 at 12:16 AM, Ryan Ollos
> <ryan.ollos@wandisco.com>wrote:
>
>> On Wed, Oct 24, 2012 at 5:29 AM, Peter Koželj <peter@digiverse.si> wrote:
>>
[...]
>>
>> When milestone, component and version are updated, the updates to the
>> milestone/component/version table and tickets table occur in a single
>> transaction (3), per my limited understanding. Priority and Severity are
>> less fortunate, as the definitions of these fields are stored in
>> trac.ini,
>> and changes to the values will not result in any ticket updates.
>>
>> (1) http://trac.edgewall.org/ticket/10925
>> (2) http://trac.edgewall.org/ticket/5658
>> (3)
>>
>> http://trac.edgewall.org/browser/trunk/trac/ticket/model.py?marks=1061,1064-1069,1075-1076&rev=11359#L1051
>
>
> That code for milestone update (reference 3) is ok (given the datamodel).
> However in bloodhound_multiproduct/multiproduct/model.py
> Product._update_relations() you can find this:
>
> for t in Product.get_tickets(self._env, old_name):
>                 ticket = Ticket(self._env, t['id'], db)
>                 ticket['product'] = new_name
>                 ticket.save_changes(author, comment, now)
>
>
> Not sure if it is single transaction or not,

it does not seem so

> but it is N SQL updates for
> sure.
>
> If you have 10000 tickets in a product, that will be 10000 roundtrips to
> the SQL server.
>

yes ... we are the ones who have to improve that code snippet and use
transactions and/or something more efficient .

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Mime
View raw message