|
Hi
I'm upgrading a Grails 1.3.7 app to 2.0.1 and running into a very strange problem. Don't know how or why but it looks like the in-memory H2 DB used drops itself or something similar. Initially all works fine but after a while the DB is just gone. Below is example output from when I just start up the application and do nothing untill a quartz job is launched. As you can see the tables it queries doesn't exist ( "SYS_DATA" , a table of mine with key value pair kind of data). Same happens if I leave it for a while before logging in. Problem happens both when run from the dos prompt using "run-app" and when run using run-app from within STS (2.9.0) Any ideas what could cause this? | Server running. Browse to http://localhost:8080/app 2012-03-17 21:58:34,037 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\mail-0.9\grails-app\views\_testemails\tagtest.gsp] added. Applying changes to application. 2012-03-17 21:58:39,070 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\mail-0.9\grails-app\views\_testemails\test.gsp] added. Applying changes to application. 2012-03-17 21:58:44,096 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\mail-0.9\grails-app\views\_testemails\testhtml.gsp] added. Applying changes to application. 2012-03-17 21:58:49,166 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\twitter-bootstrap-2.0.1.19\grails-app\views\layouts\main.gsp] added. Applying changes to application. 2012-03-17 21:58:54,187 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\twitter-bootstrap-2.0.1.19\grails-app\views\test.gsp] added. Applying changes to application. 2012-03-17 21:58:59,267 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-util\src\groovy\app\util\TextUtil.groovy.bak] added. Applying changes to application. 2012-03-17 21:59:04,321 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-app\src\java\avatar\default.gif] added. Applying changes to application. 2012-03-17 21:59:09,489 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\ckeditor-3.4.1.1-SNAPSHOT\grails-app\views\ofm.gsp] added. Applying changes to application. 2012-03-17 21:59:14,512 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-static\grails-app\views\error.gsp] added. Applying changes to application. 2012-03-17 21:59:19,637 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-util\grails-app\views\error.gsp] added. Applying changes to application. 2012-03-17 21:59:24,655 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-app\grails-app\conf\cloudfront-pk.der] added. Applying changes to application. 2012-03-17 21:59:29,673 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-app\grails-app\conf\cloudfront-pk.pem] added. Applying changes to application. 2012-03-17 21:59:34,692 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-app\grails-app\conf\DataSource.groovy.bak] added. Applying changes to application. 2012-03-17 21:59:39,708 [Thread-80] INFO compiler.GrailsProjectWatcher - File [D:\dev\workspaces\app2-trunk\app-app\grails-app\conf\ehcache.xml] added. Applying changes to application. 2012-03-17 21:59:44,799 [Thread-80] INFO compiler.GrailsProjectWatcher - File [C:\Users\User\.grails\2.0.1\projects\app\plugins\quartz-0.4.2\grails-app\conf\quartz.properties] added. Applying changes to application. | Error 2012-03-17 22:02:00,020 [quartzScheduler_Worker-1] ERROR util.JDBCExceptionReporter - Table "SYS_DATA" not found; SQL statement: select this_.id as id58_0_, this_.version as version58_0_, this_.name as name58_0_, this_.value as value58_0_ from sys_data this_ where this_.name=? limit ? [42102-147] 2012-03-17 22:02:00,041 [quartzScheduler_Worker-1] INFO core.JobRunShell - Job ConversationGroup.app.conv.ConvMessageCleanupJob threw a JobExecutionException: Message: could not execute query; SQL [select this_.id as id58_0_, this_.version as version58_0_, this_.name as name58_0_, this_.value as value58_0_ from sys_data this_ where this_.name=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query Line | Method ->> 199 | run in org.quartz.core.JobRunShell - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ^ 546 | run in org.quartz.simpl.SimpleThreadPool$WorkerThread Caused by InvalidDataAccessResourceUsageException: could not execute query; SQL [select this_.id as id58_0_, this_.version as version58_0_, this_.name as name58_0_, this_.value as value58_0_ from sys_data this_ where this_.name=?]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query ->> 105 | doCall in org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 26 | getItem in app.util.SysDataService | 27 | execute in app.conv.ConvMessageCleanupJob | 199 | run in org.quartz.core.JobRunShell ^ 546 | run in org.quartz.simpl.SimpleThreadPool$WorkerThread Caused by SQLGrammarException: could not execute query ->> 105 | doCall in org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 26 | getItem in app.util.SysDataService | 27 | execute in app.conv.ConvMessageCleanupJob | 199 | run in org.quartz.core.JobRunShell ^ 546 | run in org.quartz.simpl.SimpleThreadPool$WorkerThread Caused by JdbcSQLException: Table "SYS_DATA" not found; SQL statement: select this_.id as id58_0_, this_.version as version58_0_, this_.name as name58_0_, this_.value as value58_0_ from sys_data this_ where this_.name=? limit ? [42102-147] ->> 327 | getJdbcSQLException in org.h2.message.DbException - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 167 | get in '' | 144 | get in '' | 4562 | readTableOrView in org.h2.command.Parser | 1020 | readTableFilter in '' | 1622 | parseSelectSimpleFromPart in '' | 1729 | parseSelectSimple in '' | 1616 | parseSelectSub in '' | 1461 | parseSelectUnion in '' | 1449 | parseSelect in '' | 401 | parsePrepared in '' | 275 | parse in '' | 247 | parse in '' | 201 | prepare in '' | 214 | prepareCommand in '' | 425 | prepareLocal in org.h2.engine.Session | 374 | prepareCommand in '' | 1056 | prepareCommand in org.h2.jdbc.JdbcConnection | 71 | <init> in org.h2.jdbc.JdbcPreparedStatement | 233 | prepareStatement in org.h2.jdbc.JdbcConnection | 281 | prepareStatement in org.apache.commons.dbcp.DelegatingConnection | 313 | prepareStatement in org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper | 105 | doCall in org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2 | 26 | getItem in app.util.SysDataService | 27 | execute in app.conv.ConvMessageCleanupJob | 199 | run in org.quartz.core.JobRunShell ^ 546 | run in org.quartz.simpl.SimpleThreadPool$WorkerThread | Error 2012-03-17 22:02:00,082 [quartzScheduler_Worker-1] ERROR listeners.ExceptionPrinterJobListener - Exception occured in job: ConversationGroup.app.conv.ConvMessageCleanupJob application.properties #Grails Metadata file #Tue Mar 13 21:43:55 GMT 2012 app.grails.version=2.0.1 app.name=app app.servlet.version=2.4 app.version=1.3.0 jquery.plugins.jcrop=jquery.Jcrop.min.js plugins.bean-fields=1.0-RC3 plugins.ckeditor=3.4.1.1-SNAPSHOT plugins.cookie=0.2 plugins.feeds=1.5 plugins.foundation=2.1.4.3 plugins.google-analytics=0.3 plugins.hibernate=2.0.1 plugins.jquery=1.7.1 plugins.jquery-ui=1.8.15 plugins.mail=0.9 plugins.quartz=0.4.2 plugins.resources=1.1.6 plugins.sanitizer=0.6.2 plugins.spring-security-core=1.2.7.1 plugins.tomcat=2.0.1 plugins.twitter-bootstrap=2.0.1.19 plugins.webflow=2.0.0 Cheers, Micke |
|
Did you ever find a solution to this? I'm having a similar problem where tables are not being created in the H2 Database. Thanks,
Dean Del Ponte
On Sat, Mar 17, 2012 at 5:25 PM, Mikael Andersson <[hidden email]> wrote: Hi |
|
Nope, branched off my changes for a later date and reverted back to 1.3.7 .
When I finish with the current release of the app I'll be taking another look at upgrading, so any findings you have would be very interesting. Cheers, micke On 23 April 2012 17:34, Dean Del Ponte <[hidden email]> wrote:
|
|
I'm working on it now. I've decided to create a new grails-2.0.3 project and copy my source code into it. Seems to be working, but I'm not done yet.
- Dean Del Ponte
On Mon, Apr 23, 2012 at 1:58 PM, Mikael Andersson <[hidden email]> wrote:
|
|
Hi Dean
Did you get to the bottom of the issue you were seeing? I'm trying to upgrade my project again to Grails 2.0.4 and experiencing the same problem, where the db tables appear to be dropped somehow (H2). If anyone have any ideas about why this may happen please let me know. cheers, micke On 23 April 2012 20:35, Dean Del Ponte <[hidden email]> wrote:
|
|
FYI: Think I've found the reason my db tables get dropped.
When I have : maxIdle = 25 minIdle = 1 In the properties closure in DataSource.groovy the error happens, after a little while all tables disappear. So I'm just going to get rid of these two config values and all is hopefully good. Joy! Micke On 18 June 2012 22:10, Mikael Andersson <[hidden email]> wrote: Hi Dean |
|
Posting this for completeness sake just in case someone else runs into the same problem, earlier conclusion was wrong!
Not entirely sure what the problem is but this looks promising http://stackoverflow.com/questions/8907303/grails-throws-table-xxx-not-found On 20 June 2012 20:24, Mikael Andersson <[hidden email]> wrote: FYI: Think I've found the reason my db tables get dropped. |
|
Sorry for the monologue, but think I've found the reason now.
Seems to work when adding ;DB_CLOSE_DELAY=-1 to the jdbc url, see http://www.h2database.com/html/features.html#in_memory_databasesOn 20 June 2012 23:02, Mikael Andersson <[hidden email]> wrote: Posting this for completeness sake just in case someone else runs into the same problem, earlier conclusion was wrong! |
|
Creating a new project and copying my source code into it fixed the problem. I'm still not sure as to the cause.
- Dean Del Ponte
On Fri, Jun 22, 2012 at 1:57 AM, Mikael Andersson <[hidden email]> wrote: Sorry for the monologue, but think I've found the reason now. |
| Powered by Nabble | Edit this page |
