Problem implementing own MySQL DB Schema

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem implementing own MySQL DB Schema

Hergest
This post was updated on .
I'm implementing a SOS server with a completily different DB schema.
I've modified the "hbm.xml" hibernate files to try to "simulate" the 52N DB structure.
To simplify the process, I used the "old concept" with no transaction.
In "datasources.properties":
HIBERNATE_DIRECTORY=/mapping/core;/mapping/old/observation;/mapping/extension/readonly
sos.database.concept=OLD_CONCEPT


After many problems and changes, the server runs. But, when I tried to reload de capabilities cache, the process never finish (always "Loading Cache...").

In the log file found this errors:
(...)
2017-02-06 17:20:12,837 TRACE [Thread-14] [JdbcCoordinatorImpl.java:278] Starting after statement execution processing [ON_CLOSE]
2017-02-06 17:20:12,837 TRACE [Thread-14] [StatefulPersistenceContext.java:884] Initializing non-lazy collections
2017-02-06 17:20:12,837 DEBUG [Thread-14] [CompositeParallelAction.java:66] Executing parallel actions
2017-02-06 17:20:12,837 DEBUG [Thread-14] [CompositeParallelAction.java:82] procedure-cache-update: waiting for 2 threads to finish
2017-02-06 17:20:12,837 TRACE [procedure-cache-update-0] [SessionFactoryImpl.java:1588] Opening Hibernate Session. tenant=null, owner=null
2017-02-06 17:20:12,837 TRACE [procedure-cache-update-0] [SessionImpl.java:322] Opened session at timestamp: 14863980128
2017-02-06 17:20:12,837 TRACE [procedure-cache-update-1] [SessionFactoryImpl.java:1588] Opening Hibernate Session. tenant=null, owner=null
2017-02-06 17:20:12,837 TRACE [procedure-cache-update-1] [SessionImpl.java:322] Opened session at timestamp: 14863980128
2017-02-06 17:20:12,837 DEBUG [Thread-14] [CompositeParallelAction.java:87] Waiting for 0 threads to finish
2017-02-06 17:20:12,837 TRACE [Thread-14] [SessionImpl.java:357] Closing session
2017-02-06 17:20:12,853 TRACE [Thread-14] [JdbcCoordinatorImpl.java:199] Closing JDBC container [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl@b9e1b7]
2017-02-06 17:20:12,853 TRACE [Thread-14] [LogicalConnectionImpl.java:178] Closing logical connection
2017-02-06 17:20:12,853 TRACE [Thread-14] [LogicalConnectionImpl.java:190] Logical connection closed
2017-02-06 17:20:12,853 TRACE [Thread-14] [SessionImpl.java:357] Closing session
2017-02-06 17:20:12,853 TRACE [Thread-14] [JdbcCoordinatorImpl.java:199] Closing JDBC container [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl@191f453]
2017-02-06 17:20:12,853 TRACE [Thread-14] [LogicalConnectionImpl.java:178] Closing logical connection
2017-02-06 17:20:12,853 TRACE [Thread-14] [LogicalConnectionImpl.java:190] Logical connection closed
2017-02-06 17:20:12,853 DEBUG [Thread-14] [ProcedureCacheUpdate.java:167] Finished executing ProcedureCacheUpdate (Multi-Threaded Tasks) (0,016 s)
2017-02-06 17:20:12,884 INFO [Thread-14] [SosCacheFeederDAO.java:153] Cache load finished in 8 seconds and 250 milliseconds (PT8S seconds)
2017-02-06 17:20:12,884 TRACE [Thread-14] [SessionImpl.java:357] Closing session
2017-02-06 17:20:12,884 TRACE [Thread-14] [JdbcCoordinatorImpl.java:199] Closing JDBC container [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl@8dc1a5]
2017-02-06 17:20:12,884 TRACE [Thread-14] [LogicalConnectionImpl.java:178] Closing logical connection
2017-02-06 17:20:12,884 DEBUG [Thread-14] [LogicalConnectionImpl.java:246] Releasing JDBC connection
2017-02-06 17:20:12,884 DEBUG [Thread-14] [ThreadPoolAsynchronousRunner.java:236] com.mchange.v2.async.ThreadPoolAsynchronousRunner@3f5ecb: Adding task to queue -- com.mchange.v2.resourcepool.BasicResourcePool$1RefurbishCheckinResourceTask@a47057
2017-02-06 17:20:12,884 DEBUG [Thread-14] [BasicResourcePool.java:1801] trace com.mchange.v2.resourcepool.BasicResourcePool@1a9487a [managed: 10, unused: 10, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@119aac)
2017-02-06 17:20:12,900 DEBUG [Thread-14] [LogicalConnectionImpl.java:264] Released JDBC connection
2017-02-06 17:20:12,900 TRACE [Thread-14] [LogicalConnectionImpl.java:190] Logical connection closed
2017-02-06 17:20:12,900 TRACE [Thread-14] [ContentCacheControllerImpl.java:342] Finished update org.n52.sos.cache.ctrl.action.CompleteCacheUpdate@dca196
2017-02-06 17:20:12,900 DEBUG [Thread-14] [ContentCacheControllerImpl.java:302] State change: RUNNING -> FAILED
2017-02-06 17:20:12,900 WARN [Thread-14] [ContentCacheControllerImpl.java:347] Update failed!
org.n52.sos.ogc.ows.CompositeOwsException: Implemented series DAO is missing!
Implemented series DAO is missing!
at org.n52.sos.ds.hibernate.SosCacheFeederDAO.updateCache(SosCacheFeederDAO.java:107) ~[hibernate-dao-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.action.CompleteCacheUpdate.execute(CompleteCacheUpdate.java:45) ~[cache-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.ContentCacheControllerImpl$CompleteUpdate.execute(ContentCacheControllerImpl.java:341) [cache-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.ContentCacheControllerImpl$CompleteUpdate.execute(ContentCacheControllerImpl.java:331) [cache-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.runCurrent(ContentCacheControllerImpl.java:132) [cache-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.executeComplete(ContentCacheControllerImpl.java:182) [cache-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.update(ContentCacheControllerImpl.java:120) [cache-4.3.9.jar:na]
at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.update(ContentCacheControllerImpl.java:219) [cache-4.3.9.jar:na]
at org.n52.sos.web.admin.AbstractAdminController$1.run(AbstractAdminController.java:52) [admin-controller-4.3.9.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]
Caused by: org.n52.sos.exception.ows.NoApplicableCodeException: Implemented series DAO is missing!
at org.n52.sos.ds.hibernate.dao.DaoFactory.getSeriesDAO(DaoFactory.java:87) ~[hibernate-common-4.3.9.jar:na]
at org.n52.sos.ds.hibernate.cache.base.ProcedureCacheUpdateTask.getProcedureInformationFromDbAndAddItToCacheMaps(ProcedureCacheUpdateTask.java:70) ~[hibernate-dao-4.3.9.jar:na]
at org.n52.sos.ds.hibernate.cache.base.ProcedureCacheUpdateTask.execute(ProcedureCacheUpdateTask.java:91) ~[hibernate-dao-4.3.9.jar:na]
at org.n52.sos.util.RunnableAction.run(RunnableAction.java:55) ~[api-4.3.9.jar:na]
at org.n52.sos.util.ThreadableAction.run(ThreadableAction.java:50) ~[api-4.3.9.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_80]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_80]
... 1 common frames omitted
(...)


I don't understand the problem "Implemented series DAO is missing". There are no "series".

Any ideas?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Problem implementing own MySQL DB Schema

Hergest
Looking for the problem, I started a new DB from scratch, with the configuration:
OLD-CONCEPT
Using TRANSACTIONAL

With no data, the CACHE updates OK (It would be strange if not).

I've populated some tables with data with a pair of data (2 types of precedure/offering) using MySQL Workbench:
--------------------------
codespace:
# codespaceId, codespace
1, http://www.opengis.net/def/nil/OGC/0/unknown

featureofinteresttype:
# featureOfInterestTypeId, featureOfInterestType
1, http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint

proceduredescriptionformat:
# procedureDescriptionFormatId, procedureDescriptionFormat
20953, http://www.opengis.net/sensorML/1.0.1

procedure:
# procedureId, hibernateDiscriminator, procedureDescriptionFormatId, identifier, codespace, name,
1, T, 20953, Nivel_de_agua, 1, , , , F, F, , F
2, T, 20953, Caudal_de_agua, 1, , , , F, F, , F

offering:
# offeringId, hibernateDiscriminator, identifier, codespace, name, codespaceName, description, disabled
1, T, Nivel_de_agua, , Nivel de agua, , , F
2, T, Caudal_de_agua, , Caudal de agua, , , F

observationtype:
# observationTypeId, observationType
20953, http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement

observationconstellation:
# observationConstellationId, observablePropertyId, procedureId, observationTypeId, offeringId, deleted, hiddenChild
1, 1, 1, 20953, 1, F, F
2, 2, 2, 20953, 2, F, F

observableproperty:
# observablePropertyId, hibernateDiscriminator, identifier, codespace, name, codespaceName, description, disabled
1, T, water_discharge, 1, caudal, 1, Caudal de agua, F
2, T, water_level, 1, altura, 1, Altura del agua, F

unit:
# unitId, unit
1, m
2, m3/s
--------------------------
The data seems correct. But the cache rebuild fail:

2017-02-07 11:46:18,106 TRACE [Thread-14] [ContentCacheControllerImpl.java:342] Finished update org.n52.sos.cache.ctrl.action.CompleteCacheUpdate@127b3ff
2017-02-07 11:46:18,106 DEBUG [Thread-14] [ContentCacheControllerImpl.java:302] State change: RUNNING -> FAILED
2017-02-07 11:46:18,106 WARN [Thread-14] [ContentCacheControllerImpl.java:347] Update failed!
org.n52.sos.ogc.ows.CompositeOwsException: Implemented series DAO is missing!
Implemented series DAO is missing!
        at org.n52.sos.ds.hibernate.SosCacheFeederDAO.updateCache(SosCacheFeederDAO.java:107) ~[hibernate-dao-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.action.CompleteCacheUpdate.execute(CompleteCacheUpdate.java:45) ~[cache-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.ContentCacheControllerImpl$CompleteUpdate.execute(ContentCacheControllerImpl.java:341) [cache-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.ContentCacheControllerImpl$CompleteUpdate.execute(ContentCacheControllerImpl.java:331) [cache-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.runCurrent(ContentCacheControllerImpl.java:132) [cache-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.executeComplete(ContentCacheControllerImpl.java:182) [cache-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.update(ContentCacheControllerImpl.java:120) [cache-4.3.9.jar:na]
        at org.n52.sos.cache.ctrl.ContentCacheControllerImpl.update(ContentCacheControllerImpl.java:219) [cache-4.3.9.jar:na]
        at org.n52.sos.web.admin.AbstractAdminController$1.run(AbstractAdminController.java:52) [admin-controller-4.3.9.jar:na]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]
Caused by: org.n52.sos.exception.ows.NoApplicableCodeException: Implemented series DAO is missing!
        at org.n52.sos.ds.hibernate.dao.DaoFactory.getSeriesDAO(DaoFactory.java:87) ~[hibernate-common-4.3.9.jar:na]
        at org.n52.sos.ds.hibernate.cache.base.ProcedureCacheUpdateTask.getProcedureInformationFromDbAndAddItToCacheMaps(ProcedureCacheUpdateTask.java:70) ~[hibernate-dao-4.3.9.jar:na]
        at org.n52.sos.ds.hibernate.cache.base.ProcedureCacheUpdateTask.execute(ProcedureCacheUpdateTask.java:91) ~[hibernate-dao-4.3.9.jar:na]
        at org.n52.sos.util.RunnableAction.run(RunnableAction.java:55) ~[api-4.3.9.jar:na]
        at org.n52.sos.util.ThreadableAction.run(ThreadableAction.java:50) ~[api-4.3.9.jar:na]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_80]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_80]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_80]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_80]
        ... 1 common frames omitted

Any ideas?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Problem implementing own MySQL DB Schema

Carsten Hollmann
Hi Hergest,

this seems to be an issue in the SOS if the old database concept is
used. It would be great if you could create a GitHub issue [0] for this.

Thanks,
Carsten

[0] https://github.com/52North/SOS/issues
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: Problem implementing own MySQL DB Schema

Hergest
Yes, it seems that it is. I've been testing versions, and in 4.2.0 it's the first one that works again (in 4.3.x family get the error).