[Assorted-commits] SF.net SVN: assorted:[1423] sandbox/trunk/src/py/sqlitetest.py
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-05-18 17:00:27
|
Revision: 1423 http://assorted.svn.sourceforge.net/assorted/?rev=1423&view=rev Author: yangzhang Date: 2009-05-18 17:00:15 +0000 (Mon, 18 May 2009) Log Message: ----------- added comment Modified Paths: -------------- sandbox/trunk/src/py/sqlitetest.py Modified: sandbox/trunk/src/py/sqlitetest.py =================================================================== --- sandbox/trunk/src/py/sqlitetest.py 2009-05-18 16:59:10 UTC (rev 1422) +++ sandbox/trunk/src/py/sqlitetest.py 2009-05-18 17:00:15 UTC (rev 1423) @@ -9,13 +9,14 @@ conn.execute('INSERT INTO shelf (key, value) VALUES (?,?)', (i, i)) conn.commit() -# This will loop forever. if 0: + # This will loop forever. for i, in conn.cursor().execute('SELECT key FROM shelf ORDER BY ROWID'): conn.execute('REPLACE INTO shelf (key, value) VALUES (?,?)', (i, i)) conn.commit() print i else: + # This will timeout trying to acquire a lock on the DB from conn. conn2 = sqlite3.connect('/tmp/db') conn2.text_factory = bytes for i, in conn2.execute('SELECT key FROM shelf ORDER BY ROWID'): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |