beets/test
Adrian Sampson a28f930c52 transaction objects to control DB access
In an attempt to finally address the longstanding SQLite locking issues, I'm
introducing a way to explicitly, lexically scope transactions. The Transaction
class is a context manager that always fully fetches after SELECTs and
automatically commits on exit. No direct access to the library is allowed, so
all changes will eventually be committed and all queries will be completed. This
will also provide a debugging mechanism to show where concurrent transactions
are beginning and ending.

To support composition (transaction reentrancy), an internal, per-Library stack
of transactions is maintained. Commits only happen when the outermost
transaction exits. This means that, while it's possible to introduce atomicity
bugs by invoking Library methods outside of a transaction, you can conveniently
call them *without* a currently-active transaction to get a single atomic
action.

Note that this "transaction stack" concepts assumes a single Library object per
thread. Because we need to duplicate Library objects for concurrent access due
to sqlite3 limitation already, this is fine for now. Later, the interface should
provide one transaction stack per thread for shared Library objects.
2012-05-06 23:24:05 -07:00
..
rsrc default arguments to %aunique{} (#190) 2012-04-24 20:34:51 -07:00
__init__.py misc. overdue code cleanup 2010-07-09 18:07:15 -07:00
_common.py support move action when importing 2012-04-05 01:14:17 +02:00
test_art.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
test_autotag.py set disc and disctotal when autotagging (#226) 2012-02-07 18:03:31 -08:00
test_db.py transaction objects to control DB access 2012-05-06 23:24:05 -07:00
test_files.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
test_importer.py transaction objects to control DB access 2012-05-06 23:24:05 -07:00
test_mb.py tolerate missing language from MB (#373) 2012-04-10 11:38:45 -07:00
test_mediafile.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
test_mediafile_basic.py add a new batch of metadata fields 2012-04-04 00:52:57 -07:00
test_pipeline.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
test_player.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
test_query.py transaction objects to control DB access 2012-05-06 23:24:05 -07:00
test_template.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
test_ui.py transaction objects to control DB access 2012-05-06 23:24:05 -07:00
test_vfs.py transaction objects to control DB access 2012-05-06 23:24:05 -07:00
testall.py fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00