////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

You can refer to the link:../api/org/grails/orm/hibernate/connections/HibernateConnectionSourceSettings.html[HibernateConnectionSourceSettings] class for all available configuration options, but below is a table of the common ones:

[format="csv", options="header"]
|===
name,description,default value
`grails.gorm.flushMode`, The flush mode to use, `COMMIT`
`grails.gorm.failOnError`, Whether to throw an exception on validation error, `false`
`grails.gorm.default.mapping`,The default mapping to apply to all classes, `null`
`grails.gorm.default.constraints`,The default constraints to apply to all classes, `null`
`grails.gorm.multiTenancy.mode`,The multi tenancy mode, `NONE`
|===

The following are common configuration options for the SQL connection:

[format="csv", options="header"]
|===
name,description,default value
`dataSource.url`, The JDBC url, `jdbc:h2:mem:grailsDB`
`dataSource.driverClassName`, The class of the JDBC driver, detected from URL
`dataSource.username`, The JDBC username, `null`
`dataSource.password`, The JDBC password, `null`
`dataSource.jndiName`, The name of the JNDI resource for the `DataSource`, `null`
`dataSource.pooled`, Whether the connection is pooled, `true`
`dataSource.lazy`, Whether a `LazyConnectionDataSourceProxy` should be used, `true`
`dataSource.transactionAware`, Whether a `TransactionAwareDataSourceProxy` should be used, `true`
`dataSource.readOnly`, Whether the DataSource is read-only, `false`
`dataSource.options`, A map of options to pass to the underlying JDBC driver, `null`
|===

And the following are common configuration options for Hibernate:

[format="csv", options="header"]
|===
name,description,default value
`hibernate.dialect`, The hibernate dialect to use, detected automatically from DataSource
`hibernate.readOnly`, Whether Hibernate should be read-only, `false`
`hibernate.configClass`, The configuration class to use, `HibernateMappingContextConfiguration`
`hibernate.hbm2ddl.auto`, Whether to create the tables on startup, `none`
`hibernate.use_second_level_cache`, Whether to use the second level cache, `true`
`hibernate.cache.queries`, Whether to cache queries (see Caching Queries), `false`
`hibernate.cache.use_query_cache`, Enables the query cache, `false`
`hibernate.configLocations`, Location of additional Hibernate XML configuration files
`hibernate.packagesToScan`, Specify packages to search for autodetection of your entity classes in the classpath
|===

In addition, any additional settings that start with `hibernate.` are passed through to Hibernate, so if there is any specific feature of Hibernate you wish to configure that is possible.

TIP: The above table covers the common configuration options. For all configuration refer to properties of the link:../api/org/grails/orm/hibernate/connections/HibernateConnectionSourceSettings.html[HibernateConnectionSourceSettings] class.
