View Issue Details

IDProjectCategoryView StatusLast Update
0004822Talerbank (demonstrator)public2017-06-06 14:18
ReporterFlorian DoldAssigned ToMarcello Stanisci 
PriorityhighSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionSVN HEAD 
Target Version0.3Fixed in Version0.3 
Summary0004822: bank does not run financial transactions in database transactions
Description... django requires decorators for that.
TagsNo tags attached.

Activities

Marcello Stanisci

2016-11-29 00:45

manager   ~0011551

Florian, can you elaborate a bit more on that?

Florian Dold

2016-11-29 00:49

manager   ~0011552

Sure, see: https://docs.djangoproject.com/en/1.10/topics/db/transactions/#autocommit-details

When we do a wire transfer, we of course have to touch multiple accounts. But these write operations are currently not run within a DB transaction, due to Django's autocommit behavior.

Marcello Stanisci

2016-12-22 17:10

manager   ~0011608

Shall I wait your refactoring to be complete to work on this one?

Marcello Stanisci

2017-01-31 14:59

manager   ~0011682

From [1], it seems that no decorators are needed. Just setting your DB as "atomic" should make it.

[1] https://docs.djangoproject.com/en/1.9/topics/db/transactions/#tying-transactions-to-http-requests

Marcello Stanisci

2017-01-31 15:03

manager   ~0011683

OTOH, [2] is better, as you're not forced to be in a view to have transactions.

[2] https://docs.djangoproject.com/en/1.9/topics/db/transactions/#controlling-transactions-explicitly

Marcello Stanisci

2017-02-04 10:54

manager   ~0011689

According to the recent refactoring, there might be few or no places
where this fix should be done.

Marcello Stanisci

2017-02-06 21:36

manager   ~0011699

3ae843c. The fix occurred at user registration and in wire_transfer().

Issue History

Date Modified Username Field Change
2016-11-29 00:39 Florian Dold New Issue
2016-11-29 00:39 Florian Dold Status new => assigned
2016-11-29 00:39 Florian Dold Assigned To => Marcello Stanisci
2016-11-29 00:45 Marcello Stanisci Note Added: 0011551
2016-11-29 00:49 Florian Dold Note Added: 0011552
2016-12-22 17:10 Marcello Stanisci Note Added: 0011608
2017-01-31 14:59 Marcello Stanisci Note Added: 0011682
2017-01-31 15:03 Marcello Stanisci Note Added: 0011683
2017-02-04 10:54 Marcello Stanisci Priority normal => high
2017-02-04 10:54 Marcello Stanisci Note Added: 0011689
2017-02-06 21:36 Marcello Stanisci Status assigned => resolved
2017-02-06 21:36 Marcello Stanisci Resolution open => fixed
2017-02-06 21:36 Marcello Stanisci Note Added: 0011699
2017-02-13 13:46 Christian Grothoff Product Version => SVN HEAD
2017-02-13 13:46 Christian Grothoff Fixed in Version => 0.3
2017-02-13 13:46 Christian Grothoff Target Version => 0.3
2017-06-06 14:18 Christian Grothoff Status resolved => closed