source: trunk/grails-app/conf/DataSource.groovy @ 894

Last change on this file since 894 was 878, checked in by gav, 14 years ago

Add MySQL5InnoDBDialect to DataSource.groovy, helps with schema generation and checking.

File size: 3.4 KB
Line 
1dataSource {
2    // Open separate connections to database for every request or pool connections.
3    pooled = true
4}
5hibernate {
6    cache.use_second_level_cache=true
7    cache.use_query_cache=true
8    cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider'
9}
10
11// dbCreate options.
12// create-drop: Drop and re-create the database tables on restart. Deletes existing data.
13// create:       Create the database if it doesn't exist, but don't modify it if it does. Deletes existing data.
14// update:     Create the database if it doesn't exist, and modify it if it does exist. Keep data.
15// If nothing specified then do nothing to database schema.
16
17// Environment specific settings.
18environments {
19    development {
20        dataSource {
21            /** HSQLDB - In memory */
22            driverClassName = "org.hsqldb.jdbcDriver"
23            username = "sa"
24            password = ""
25            dbCreate = "create-drop"
26            url = "jdbc:hsqldb:mem:devDb"
27            /** MySQL */
28//             dialect = org.hibernate.dialect.MySQL5InnoDBDialect
29//             driverClassName = "com.mysql.jdbc.Driver"
30//             username = "gnumimsadmin"
31//             password = "gnumimsadmin"
32//             dbCreate = "create-drop"
33//             url = "jdbc:mysql://host:3306/gnumims_dev?autoReconnect=true&sessionVariables=storage_engine=InnoDB"
34        }
35    }
36    test {
37        dataSource {
38            /** HSQLDB - In memory */
39            driverClassName = "org.hsqldb.jdbcDriver"
40            username = "sa"
41            password = ""
42            dbCreate = "update"
43            url = "jdbc:hsqldb:mem:devDb"
44            /** MySQL */
45//             dialect = org.hibernate.dialect.MySQL5InnoDBDialect
46//             driverClassName = "com.mysql.jdbc.Driver"
47//             username = "gnumimsadmin"
48//             password = "gnumimsadmin"
49//             dbCreate = "update"
50//             url = "jdbc:mysql://host:3306/gnumims_test?autoReconnect=true&sessionVariables=storage_engine=InnoDB"
51        }
52    }
53    production {
54        dataSource {
55            /* Delete dbCreate line after setup! */
56            /** HSQLDB - In memory */
57//             driverClassName = "org.hsqldb.jdbcDriver"
58//             username = "sa"
59//             password = ""
60//             dbCreate = "create-drop"
61//             url = "jdbc:hsqldb:mem:devDb"
62            /** HSQLDB - In file */
63//             driverClassName = "org.hsqldb.jdbcDriver"
64//             username = "sa"
65//             password = ""
66//             dbCreate = "update"
67//             url = "jdbc:hsqldb:file:prodDb;shutdown=true"
68            /** MSSQL */
69            //For more info see the docs that you downloaded with the driver.
70//             dialect = org.hibernate.dialect.SQLServerDialect // MSSQL 2000+2005 Useful with `grails schema-export`
71//             driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
72//             username = "gnumimsadmin"
73//             password = "gnumimsadmin"
74//             dbCreate = "update"
75//             url = "jdbc:sqlserver://gnumimssql01:1433;databaseName=gnumims_prod"
76            /** MySQL */
77            dialect = org.hibernate.dialect.MySQL5InnoDBDialect
78            driverClassName = "com.mysql.jdbc.Driver"
79            username = "gnumimsadmin"
80            password = "gnumimsadmin"
81            dbCreate = "update"
82            url = "jdbc:mysql://gnumimssql01:3306/gnumims_prod?autoReconnect=true&sessionVariables=storage_engine=InnoDB"
83        }
84
85    }
86}
Note: See TracBrowser for help on using the repository browser.