-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transactionize the search engine and commands #1335
Transactionize the search engine and commands #1335
Conversation
…r-1318-search-cmds
|
||
return Study.create(User(owner), title, efo_ids, infodict) | ||
return Study.create(User(owner), title, efo_ids, infodict) |
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.
should this return be outside the TRN? I guess it doesn't matter but rather ask ...
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.
Nope, that return is executing multiple access to the DB at different points: User(owner)
and in Study.create...
. Also, if something during the creation goes wrong, I want the entire transaction to rollback, so no modifications in the DB are performed (there are some StudyPerson.create
above)
A few questions. |
@antgonza I think I've answered your questions and addressed your comments. |
@squirrelo can you review this one? |
👍 |
1 similar comment
👍 |
Transactionize the search engine and commands
I discovered an issue with the Transaction object: it was always passing an empty list to psycopg2. This is not a problem unless we are passing
%
chars in the SQL query, which are passed in the search engine for theLIKE
-alike queries.I just added a small check in the Transaction object that instead of passing an empty list, it will pass None, which doesn't create any problem.