-
Notifications
You must be signed in to change notification settings - Fork 9
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
SQLite doesn't work in a multiple server with PostgreSQL #127
Comments
Thanks. Another thing to note is that the TravisCI odm2-timeseries-dao test (which uses the SQLite DB) is passing. I know those tests are limited, but still, it's an indication that the problem may not be with the DAO changes.
So, you're saying you can set up a multi-server with SQLite and MySQL, as long as there's no footprint from postgresql (ie, just like you had it previously)? Otherwise, I don't follow what you're saying. Seems obvious that if you want to set up SQLite and MySQL only, you wouldn't include fragments from any other DAO instance that's not being used. |
Yepp. Exactly that. |
ok. makes sense. |
Querying BehaviorsAn interesting behavior is found when querying SQLite and MySQLWhen querying GetSites, the actual query is grabbing from SELECT DISTINCT sites.samplingfeatureid AS odm2_sites_samplingfeatureid, samplingfeatures.samplingfeatureid AS odm2_samplingfeatures_samplingfeatureid, sites.spatialreferenceid AS odm2_sites_spatialreferenceid, sites.sitetypecv AS odm2_sites_sitetypecv, sites.latitude AS odm2_sites_latitude, sites.longitude AS odm2_sites_longitude, samplingfeatures.samplingfeatureuuid AS odm2_samplingfeatures_samplingfeatureuuid, samplingfeatures.samplingfeaturetypecv AS odm2_samplingfeatures_samplingfeaturetypecv, samplingfeatures.samplingfeaturecode AS odm2_samplingfeatures_samplingfeaturecode, samplingfeatures.samplingfeaturename AS odm2_samplingfeatures_samplingfeaturename, samplingfeatures.samplingfeaturedescription AS odm2_samplingfeatures_samplingfeaturedescription, samplingfeatures.samplingfeaturegeotypecv AS odm2_samplingfeatures_samplingfeaturegeotypecv, samplingfeatures.elevation_m AS odm2_samplingfeatures_elevation_m, samplingfeatures.elevationdatumcv AS odm2_samplingfeatures_elevationdatumcv, samplingfeatures.featuregeometrywkt AS odm2_samplingfeatures_featuregeometrywkt,
CASE WHEN (samplingfeatures.samplingfeaturetypecv = %s) THEN %s WHEN (samplingfeatures.samplingfeaturetypecv = %s) THEN %s ELSE %s END AS _sa_polymorphic_on
FROM samplingfeatures INNER JOIN sites ON samplingfeatures.samplingfeatureid = sites.samplingfeatureid INNER JOIN featureactions ON samplingfeatures.samplingfeatureid = featureactions.samplingfeatureid
INNER JOIN (results INNER JOIN timeseriesresults ON results.resultid = timeseriesresults.resultid) ON featureactions.featureactionid = results.featureactionid
WHERE featureactions.samplingfeatureid = sites.samplingfeatureid AND results.featureactionid = featureactions.featureactionid SQLite and PostgresqlWhen querying GetSites, the actual query is grabbing from SELECT DISTINCT odm2.sites.samplingfeatureid AS odm2_sites_samplingfeatureid, odm2.samplingfeatures.samplingfeatureid AS odm2_samplingfeatures_samplingfeatureid, odm2.sites.spatialreferenceid AS odm2_sites_spatialreferenceid, odm2.sites.sitetypecv AS odm2_sites_sitetypecv, odm2.sites.latitude AS odm2_sites_latitude, odm2.sites.longitude AS odm2_sites_longitude, odm2.samplingfeatures.samplingfeatureuuid AS odm2_samplingfeatures_samplingfeatureuuid, odm2.samplingfeatures.samplingfeaturetypecv AS odm2_samplingfeatures_samplingfeaturetypecv, odm2.samplingfeatures.samplingfeaturecode AS odm2_samplingfeatures_samplingfeaturecode, odm2.samplingfeatures.samplingfeaturename AS odm2_samplingfeatures_samplingfeaturename, odm2.samplingfeatures.samplingfeaturedescription AS odm2_samplingfeatures_samplingfeaturedescription, odm2.samplingfeatures.samplingfeaturegeotypecv AS odm2_samplingfeatures_samplingfeaturegeotypecv, odm2.samplingfeatures.elevation_m AS odm2_samplingfeatures_elevation_m, odm2.samplingfeatures.elevationdatumcv AS odm2_samplingfeatures_elevationdatumcv, odm2.samplingfeatures.featuregeometrywkt AS odm2_samplingfeatures_featuregeometrywkt,
CASE WHEN (odm2.samplingfeatures.samplingfeaturetypecv = ?) THEN ? WHEN (odm2.samplingfeatures.samplingfeaturetypecv = ?) THEN ? ELSE ? END AS _sa_polymorphic_on
FROM odm2.samplingfeatures JOIN odm2.sites ON odm2.samplingfeatures.samplingfeatureid = odm2.sites.samplingfeatureid JOIN odm2.featureactions ON odm2.samplingfeatures.samplingfeatureid = odm2.featureactions.samplingfeatureid
JOIN (odm2.results JOIN odm2.timeseriesresults ON odm2.results.resultid = odm2.timeseriesresults.resultid) ON odm2.featureactions.featureactionid = odm2.results.featureactionid
WHERE odm2.featureactions.samplingfeatureid = odm2.sites.samplingfeatureid AND odm2.results.featureactionid = odm2.featureactions.featureactionid MySQL BehaviorMySQL queries are similar as SQLite. When paired with SQLite, it's querying By default (when isolated) MySQL queries with |
Yikes. I think this is getting too complicated, and I don't think it's important enough at this time to have a working capability to mix SQLite and PostgreSQL. So, unless you're now very close to solving it, I'd say let's table this until after the next release. For the amazon cloud multi-server example, use MySQL LBR + PostgreSQL EnviroDIY (what you had this morning). |
Agreed. I have no idea, where the logic for this behavior resides. Thanks. |
SQLite Issue with Postgresql
This is an issue regarding the SQLite database, not working when paired with PostgreSQL in a multiple WOFpy server environment.
Runserver script
Here's my runserver script:
When the script is ran, I do not get an error, it seems like all the 3 instance ran just fine.
The problem
The problem lies when I tried one of the WOF Rest Service links such as
GetSites
:http://127.0.0.1:8080/sqliteodm2timeseries/rest/1_1/GetSites
.I get this error:
Original thought
In order for me to run SQLite and MySQL I have to comment out the part where I am creating the Postgresql DAO object and Config Object or else it will give the same error:
Ping @emiliom
The text was updated successfully, but these errors were encountered: