ODM2 / ODM2PythonAPI

A set of Python functions that provides data read/write access to an ODM2 database by leveraging SQLAlchemy.
http://odm2.github.io/ODM2PythonAPI/
BSD 3-Clause "New" or "Revised" License
4 stars 13 forks source link

samplingfeaturedatasets datasets permanently appending to all objects. #130

Closed Elijahwalkerwest closed 6 years ago

Elijahwalkerwest commented 6 years ago

Doing some testing with Mauriel today we discovered a strange behavior. Only the first query made returns accurate data. Each further query appends the datasets of all previous queries to a consistent object. E.G.

If you start the server and query id 1001, it returns 2 datasets.

If you start the server and query id 1002 it returns 3 datasets.

However if you first query 1001, then 1002, both objects show 5 datasets instead.

And if you after that make a query for ONLY 1003, (Which should only have 2 datasets) It will contain every dataset queried so far. So, 7 in total.

So each object acquires the dataset of each previously queried object. This also explains why the query is so monstrously slow. Instead of a a set of 3 objects that contain 2, 3, and 2 datasets. It's 3 objects that each contains 7 datasets. Which, if you are querying a large amount of ID's, get's absurdly large.

Additionally, it seems to break every FURTHER query. i.e. once you query any two samplingfeature ID's, all further queries will have thei datasets appended. So it seems each time a unique dataset is queried, it is permanently added to datasets of each object.

lsetiawan commented 6 years ago

This issue has been addressed by PR #131. Closing.