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

Multithreading error on ODM2 SQLite and MySQL when trying to implement odm2api-based queries #112

Open
lsetiawan opened this issue May 1, 2017 · 6 comments

Comments

@lsetiawan
Copy link
Member

This is following up to previous issue on SQLite after dao was updated to use odm2api querying engine. A test was done on MySQL Little Bear Database, and when the server is live I am getting

Error running Query: (pymysql.err.InternalError) Packet sequence number wrong - got 109 expected 1 ...

This is similar to issue 75 for SQLite.

After some research, I get to the same conclusion of queries not being closed each time it's done. This causes the multithreading errors.

Resource:

@emiliom
Copy link
Member

emiliom commented May 2, 2017

Thanks, @lsetiawan. Darn. I'll try to take a look later.

@lsetiawan
Copy link
Member Author

One difference I see between how the wofpy dao is querying is that scoped_session is used, but odm2api is not using that.

scoped_session is an approach for Session Management. Without scoped_session, the session doesn't seem to close at the end of a request. Causing a multithreading error.

Resource:

@emiliom emiliom changed the title Multithreading error on SQLite and MySQL Multithreading error on ODM2 SQLite and MySQL when trying to implement odm2api-based queries May 2, 2017
@emiliom
Copy link
Member

emiliom commented May 2, 2017

Just for reference: this issue is linked to PR #111. See that PR (now closed) for related discussions.

@sreeder
Copy link

sreeder commented May 15, 2017

@lsetiawan the newest odm2api release is using the scoped_session.

@lsetiawan
Copy link
Member Author

@sreeder Woo hoo! Great! Thanks 😄

@emiliom
Copy link
Member

emiliom commented May 16, 2017

@sreeder I noticed this in the notes to the odm2api release. That's great, and thanks for letting us know here.

We're very close to a new wofpy release. To minimize uncertainties and new work, I'd rather keep odm2api querying out of this release, and stick to the current approach (almost pure SQLAlchemy, except for importing and using odm2api.ODM2.models). Then after the release we can revisit odm2api integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants