Read Only Grails Hibernation Session

I have two grails servers:

  • Server - has read / write access to the database
  • Web - has read-only access to the database, and for each entry it sends a request to the server

Problem: How to make web domain objects accessible only for one place (configuration file) for the entire application launch, instead of writing caching: read-only for each domain class mapping.

+3
source share
2 answers

Parameter from http://www.nabble.com/database-read-only-td20360158.html

pooled = true DataSource.groovy, org.apache.commons.dbcp.BasicDataSource. DefaultReadOnly BootStrap.groovy:

class BootStrap { 

      def dataSource 

      def init = { servletContext -> 
         dataSource.defaultReadOnly = true 
      } 

      def destroy = {} 
} 
+2

1.3.7

[dataSourceUnproxied] [dataSource]

+2

Source: https://habr.com/ru/post/1716485/


All Articles