Skip to content
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

Merged
merged 4 commits into from
Jul 7, 2015

Conversation

josenavas
Copy link
Contributor

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 the LIKE-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.

@josenavas josenavas added this to the Alpha 0.2 milestone Jul 7, 2015
@josenavas josenavas mentioned this pull request Jul 7, 2015
28 tasks

return Study.create(User(owner), title, efo_ids, infodict)
return Study.create(User(owner), title, efo_ids, infodict)
Copy link
Member

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 ...

Copy link
Contributor Author

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)

@antgonza
Copy link
Member

antgonza commented Jul 7, 2015

A few questions.

@josenavas
Copy link
Contributor Author

@antgonza I think I've answered your questions and addressed your comments.

@josenavas
Copy link
Contributor Author

@squirrelo can you review this one?

@antgonza
Copy link
Member

antgonza commented Jul 7, 2015

👍

1 similar comment
@squirrelo
Copy link
Contributor

👍

squirrelo added a commit that referenced this pull request Jul 7, 2015
Transactionize the search engine and commands
@squirrelo squirrelo merged commit 7f1ace0 into qiita-spots:transaction Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants