Skip to content

Commit

Permalink
(WCM-903) Preparing to release
Browse files Browse the repository at this point in the history
  • Loading branch information
julyantonicheva committed Nov 27, 2014
1 parent 9eb0875 commit 709b21a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
5 changes: 3 additions & 2 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ grails.war.resources = { stagingDir, args ->
}

grails.tomcat.jvmArgs = ["-Xmx1024m", "-XX:MaxPermSize=256m", '-verbose:class']

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
Expand Down Expand Up @@ -40,9 +41,9 @@ grails.project.dependency.resolution = {
compile ':cache:1.1.8'
compile ':scaffolding:2.1.2'

// plugins needed at runtime but not for compilation
runtime ':hibernate4:4.3.5.5'
runtime ":hibernate4:4.3.5.5" // or ":hibernate:3.6.10.17"
runtime ":database-migration:1.4.0"

runtime ':elasticsearch:0.0.3.6'
runtime ":jquery:1.11.1"
compile ":jquery-ui:1.10.4"
Expand Down
15 changes: 14 additions & 1 deletion grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ grails {
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true

// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
grails.hibernate.cache.queries = false

// configure passing transaction's read-only attribute to Hibernate session, queries and criterias
// set "singleSession = false" OSIV mode in hibernate configuration after enabling
grails.hibernate.pass.readonly = false
// configure passing read-only to OSIV session by default, requires "singleSession = false" OSIV mode
grails.hibernate.osiv.readonly = false


weceem.profile.url = [controller:'userProfile', action:'edit']
weceem.logout.url = [controller:'logout']
Expand Down Expand Up @@ -201,6 +210,8 @@ if (config?.elasticSearch) {
elasticSearch.datastoreImpl = 'hibernateDatastore'
elasticSearch.bulkIndexOnStartup = true
elasticSearch.disableAutoIndex = false
elasticSearch.client.mode = 'local'
elasticSearch.index.store.type = 'memory' // store local node in memory and not on disk
}

environments {
Expand Down Expand Up @@ -239,7 +250,9 @@ environments {
test {
}
production {

if (config?.elasticSearch) {
elasticSearch.client.mode = 'local'
}
log4j = {
appenders {
rollingFile name: 'fileLog',
Expand Down
1 change: 1 addition & 0 deletions grails-app/conf/DataSource.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dataSource {
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
dialect = com.jcatalog.hibernate.dialect.ImprovedH2Dialect
}

hibernate {
Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/org/weceem/auth/CMSUser.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CMSUser {
/** plain password to create a MD5 password */
String pass = "secret"

static mappingRole = {
static mapping = {
cache usage: 'read-write'
username index: 'userName_Idx'
}
Expand Down
24 changes: 24 additions & 0 deletions src/groovy/com/jcatalog/hibernate/dialect/ImprovedH2Dialect.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.jcatalog.hibernate.dialect

import org.hibernate.dialect.H2Dialect
/**
* Workaround.
*
* @see https://hibernate.onjira.com/browse/HHH-7002
*
*/
public class ImprovedH2Dialect extends H2Dialect {
@Override
public String getDropSequenceString(String sequenceName) {
// Adding the "if exists" clause to avoid warnings
return "drop sequence if exists " + sequenceName;
}

@Override
public boolean dropConstraints() {
// We don't need to drop constraints before dropping tables, that just
// leads to error messages about missing tables when we don't have a
// schema in the database
return false;
}
}

0 comments on commit 709b21a

Please sign in to comment.