-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
e932fdd
to
db66ad3
Compare
480713b
to
a8b8cec
Compare
|
||
- A transaction now covers the whole request/response cycle (#510, Kinto/kinto#194). | ||
If an error occurs during the request processing, every operation performed | ||
is rolled back. **Note:** This is only enabled with *PostgreSQL* backends. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens when I have a postgres backend for the storage and redis for the cache ? can you confirm cache changes are also rolled back ?
13668b9
to
cb3d55c
Compare
This is now ready to review/merge |
""" | ||
connection = None | ||
trans = None | ||
with_transaction = (not readonly and self.commit_manually) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need parentheses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, it's a custom we have for boolean exprs. Do you want me to get rid of it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reference is always the (recent) Python stdlib for style. It's not considered "pythonic" to have superfluous characters. The typical example is for tuple.
one = two, three, four # do this
one = (two, three, four) # not this
One exception of avoiding \ to break a line.
e.g. do:
import (one, two,
three) # yes!!
import one, two, \
three # boooo!
So I guess my question is: what's the benefit for our code base to do this differently ? If none, I am +1 to use Python stdlib conventions. (We should check of course that it's wlays done like that there :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 agree
localtimestamp always returns the same timestamp within a transaction. clock_timestamp() is a lot more precise, and differs even within the same statement. SELECT clock_timestamp() = clock_timestamp(); > false
cb3d55c
to
534cdb4
Compare
r+ |
Perform one transaction per request (Kinto/kinto#194)
Relax content-type validation when no body is posted (fixes #507)
Two-phase commit accross backends ?Session is shared accross backends if URL is the same