Missing spatialindex table for multinode with Postgres/Postgis

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Missing spatialindex table for multinode with Postgres/Postgis

Heng, Jiabin - ARS

Hi GeoNetwork developers,


We recently started to explore using multi nodes and were having problems with spatial index in PostGIS. I asked the question a few days ago in user list but didn’t get a response, so I post it here to see if developers have any ideas.


We are running GeoNetwork 3.4.2, Java 8, Tomcat 8, Postgres 9.4, PostGIS (2.2.7 & 2.3.2), after configuring the new node, “spatialindex” table is missing from the database for new node, instead, new node is writing spatial index into the “spatialindex” table in the database for srv node. And I am not able to delete any record on the new node due to a ObjectOptimisticLockingFailureException.


I followed user manual and manually registered the node


<beans default-lazy-init="true"





    <import resource="classpath*:/config-spring-geonetwork.xml"/>

    <import resource="../config-db/database_migration.xml"/>


    <context:property-override properties-ref="newnode-configuration-overrides" />


    <bean id="nodeInfo" class="org.fao.geonet.NodeInfo">

        <property name="id" value="newnode" />

        <property name="defaultNode" value="false" />



   <bean id="newnode-configuration-overrides"


        <property name="properties">


                <prop key="jdbcDataSource.username">username</prop>

                <prop key="jdbcDataSource.password">password</prop>

                <prop key="jdbcDataSource.maxActive">10</prop>

                <prop key="jdbcDataSource.maxIdle">10</prop>

                <prop key="jdbcDataSource.initialSize">10</prop>

                <prop key="jdbcDataSource.Url">jdbc:postgresql_postGIS://localhost:5432/geonetwork_newnode</prop>





    <import resource="../config-db/postgres-postgis.xml"/>



I have different databases ready

srv: geonetwork

newnode: geonetwork_newnode


After restart geonetwork, the new node is running and 60 tables were created in the new database (geonetwork_newnode), but I didn’t find the “spatialindex” table.  After spending a lot of time trying to figure out why “spatialindex” was not created in the new database, I finally discovered that the new node is also writing spatial index into the “spatialindex” table in the database (geonetwork) for “srv” node. Every time a new record is imported on “newnode”, it is inserted into “public.metadata” table in geonetwork_newnode DB, but spatial index goes to “public.spatialindex” table in geonetwork DB.


I tried to delete a record on “newnode” to see if its spatial index will be removed from the “srv” database, but found that I couldn’t delete any records on “newnode” (while the default “srv” node is working fine), delete request returns 400.

DELETE http://localhost:8080/geonetwork/newnode/api/records/124



{"message":"ObjectOptimisticLockingFailureException","code":"runtime_exception","description":"Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1"}


This may be related to the misplaced spatial index, but I am not sure.

If anyone has any ideas about this issue, we would greatly appreciate it.




Jiabin Heng

Geospatial Information Specialist

Email: [hidden email]

This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
GeoNetwork-devel mailing list
[hidden email]
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork