Trying to get SQLite to work with grails ... the material I found on the Internet seems a bit dated - links to ivy and plugins, etc., but based on them:
http://stackoverflow.com/questions/1199512/grails-sqlite
http://bigohno.blogspot.com/2010/01/groovy-on-grails-sqlite.html
http://maven-repository.com/artifact/org.xerial/sqlite-jdbc/3.6.17
I managed to get it to work in a test environment ... strange, when I "prod war" my grails application and deploy it to tomcat, it fails:
Dialect class not found: hibernate.SQLiteDialect
Here is my setup:
a class for SQLiteDialect has been added to conf / hibernate. This .java was taken from here http://code.google.com/p/hibernate-sqlite/
Then in my DataSource.groovy I have:
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
environments {
development {
dataSource {
dbCreate="update"
url='jdbc:sqlite:C:\\sqlite-shell-win32-x86-3080100\\rss_1.db'
logSql="true"
dialect="hibernate.SQLiteDialect"
driverClassName="org.sqlite.JDBC"
readOnly="true"
}
}
production {
dataSource {
dbCreate="update"
url="jdbc:sqlite:/opt/sqlite/dbs/rss/1/rss_1.db"
logSql="true"
dialect="hibernate.SQLiteDialect"
driverClassName="org.sqlite.JDBC"
readOnly="true"
showsql="false"
}
}
}
and in BuildConfig.groovy I have:
dependencies {
runtime 'org.xerial:sqlite-jdbc:3.6.17'
}
I also jar'd up the .java dialog class and inserted it into lib - some posts said this helped. I also added sqlite-jdbc-3.7.15-M1.jar to lib.
, , ... tomcat, .
- , prod ?