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

adminrules not working on postgres dedicated schema #109

Open
oomsb opened this issue May 3, 2018 · 3 comments
Open

adminrules not working on postgres dedicated schema #109

oomsb opened this issue May 3, 2018 · 3 comments

Comments

@oomsb
Copy link

oomsb commented May 3, 2018

I have found the issue that the adminrules are not working when using a schema other then public on a postgis setup. The admin rule lookup query uses references to the public.gf_adminrule and public.gf_gsinstance tables.
The solution was to create a dedicated database for the geofence instance and using its public schema.
The used version was a 3.3-SNAPSHOT

##Old config 
geofenceVendorAdapter.databasePlatform=org.hibernatespatial.postgis.PostgisDialect
geofenceDataSource.driverClassName=org.postgresql.Driver
geofenceDataSource.url=jdbc:postgresql://postgresqldmz.domain.be:5432/dbgis
geofenceDataSource.username=geofencedev
geofenceDataSource.password=***
geofenceEntityManagerFactory.jpaPropertyMap[hibernate.default_schema]=geofencedev

geofenceEntityManagerFactory.jpaPropertyMap[hibernate.hbm2ddl.auto]=update
geofenceEntityManagerFactory.jpaPropertyMap[javax.persistence.validation.mode]=none
geofenceEntityManagerFactory.jpaPropertyMap[hibernate.validator.apply_to_ddl]=false
geofenceEntityManagerFactory.jpaPropertyMap[hibernate.validator.autoregister_listeners]=false  

# Switch the DAOs from DB to LDAP
geofence_dao_registry.selectedType = LDAP
NEW config:
geofenceVendorAdapter.databasePlatform=org.hibernatespatial.postgis.PostgisDialect
geofenceDataSource.driverClassName=org.postgresql.Driver
geofenceDataSource.url=jdbc:postgresql://postgresqldmz.domain:5432/geofencedev2
geofenceDataSource.username=geofencedev2
geofenceDataSource.password=***
geofenceEntityManagerFactory.jpaPropertyMap[hibernate.default_schema]=public

geofenceEntityManagerFactory.jpaPropertyMap[hibernate.hbm2ddl.auto]=update
geofenceEntityManagerFactory.jpaPropertyMap[javax.persistence.validation.mode]=none
geofenceEntityManagerFactory.jpaPropertyMap[hibernate.validator.apply_to_ddl]=false
geofenceEntityManagerFactory.jpaPropertyMap[hibernate.validator.autoregister_listeners]=false  

# Switch the DAOs from DB to LDAP
geofence_dao_registry.selectedType = LDAP
@randomorder
Copy link
Member

thanks @oomsb
This it is still relevant as it bit me too today

@etj
Copy link
Member

etj commented Dec 2, 2020

I've been checking if this is a geofence persistence issue or a geoserver extension configuration.

  • add a maven profile to test postgres.
    We need a maven profile in the geofence/modules/rest/test in order to be able to switch from H2 to PG to test the PG schema configuration.
  • check geofence-server configuration.
    If geofence persistence is ok, it should be a matter of configuration (the datasource PropertyOverrider bean and related properties files)
  • add documentation about datasource bean and overrides.
    Also, some documentation should be added about how db configuration is performed.

@simboss
Copy link
Member

simboss commented Dec 2, 2020

thanks ema, pushed to backlog for the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants