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

Database mismatch problem #3

Open
iMHLv2 opened this issue Jul 25, 2014 · 0 comments
Open

Database mismatch problem #3

iMHLv2 opened this issue Jul 25, 2014 · 0 comments

Comments

@iMHLv2
Copy link

iMHLv2 commented Jul 25, 2014

If you open two databases (tied to unique SQLite files on disk) and then query records:

snap1 = Snapshot.select(db = db1).first()
snap2 = Snapshot.select(db = db2).first()

At this time, snap1 == snap2 even though db1 and db2 are different. Also, snap1.database() == snap2.database(). Thus the underlying database associated with snap1 somehow gets set to the database for snap2.

The only way to fix is to explicitly set the database for snap1 back to db1 after the query:

snap1.setDatabase(db1)
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

No branches or pull requests

1 participant