Roundup Tracker - Issues

Message4730

Author schlatterbeck
Recipients ThomasAH, ber, ezio.melotti, rouilj, schlatterbeck
Date 2013-01-07.11:00:15
Message-id <20130107110013.GA4812@runtux.com>
In-reply-to <20130107091808.GA18135@runtux.com>
On Mon, Jan 07, 2013 at 09:18:17AM +0000, Ralf Schlatterbeck wrote:
> Example concurrent sessions:
Sorry I failed when transcribing this. The updated property is different
in both sessions, in Session 2 I've updated the property "release" not
"title":

Session 1                               Session 2
>>> import os                           >>> import os
>>> from roundup import instance        >>> from roundup import instance
>>> dir     = os.getcwd ()              >>> dir     = os.getcwd ()
>>> tracker = instance.open (dir)
                                        >>> tracker = instance.open (dir)
>>> db      = tracker.open ('admin')
                                        >>> db      = tracker.open ('admin')
>>> i = db.issue.getnode ('1')          
                                        >>> i = db.issue.getnode ('1')
>>> db.issue.set ('1', title = "HUHU")
                                        >>> db.issue.set ('1', release = "23")
                                        [hangs]
>>> db.commit ()
                                        Traceback (most recent call last):
                                        ...
                                        psycopg2.extensions.TransactionRollbackError: could not serialize access due to concurrent update

The important point here is that Session 2 is rolled back because setting
the release *could* depend on the property "title" written by Session 1.
The SQL machinery notes that the transaction of Session 2 reads all the
properties of issue1 and detects that they *could* conflict.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com
osAlliance member                       email: rsc@osalliance.com
History
Date User Action Args
2013-01-07 11:00:15schlatterbecksetrecipients: + schlatterbeck, ber, rouilj, ThomasAH, ezio.melotti
2013-01-07 11:00:15schlatterbecklinkissue2550731 messages
2013-01-07 11:00:15schlatterbeckcreate