DB update error for H2

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DB update error for H2

Mavlarn

Hi Juno,


I got an error during DB updtae for H2.


Today, I want to use local H2 DB to test, but it alwasy fail. The error message is as below.

From the message I noticed:"Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:"

And I also find the class "H2ExTypeConverter", which is overwrited by us to make the value of boolean type as "T" and "F". But from the log, it still get "TRUE".


And in DatabaseUpdater.init(), I found the code :

TypeConverterFactory.getInstance().register(H2ExTypeConverter.class);

It always register the type converter of H2. Is it proper to add this converter all the time?


2012-11-12 13:08:50 org.apache.catalina.core.StandardContext listenerStart

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseUpdater': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:728)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449)

at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4172)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4671)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)

at org.apache.catalina.startup.Catalina.start(Catalina.java:585)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseUpdater': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:135)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:400)

at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)

at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)

at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:103)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1475)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1443)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

... 25 more

Caused by: org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB

at org.ngrinder.infra.init.DatabaseUpdater.init(DatabaseUpdater.java:98)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)

... 44 more

Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set ngrinder_datachange_logfile/db.changelog_schema_H2_5.xml::5::ngrinder.3.0-b3:

     Reason: liquibase.exception.DatabaseException: Error executing SQL alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1);: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]:

          Caused By: Error executing SQL alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1);: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]:

          Caused By: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)

at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)

at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)

at org.ngrinder.infra.init.LiquibaseEx.update(LiquibaseEx.java:68)

at org.ngrinder.infra.init.DatabaseUpdater.init(DatabaseUpdater.java:96)

... 51 more

Caused by: liquibase.exception.DatabaseException: Error executing SQL alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1);: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)

at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)

at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075)

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)

... 55 more

Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]

at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)

at org.h2.message.DbException.get(DbException.java:169)

at org.h2.table.Column.validateConvertUpdateSequence(Column.java:315)

at org.h2.table.Table.validateConvertUpdateSequence(Table.java:689)

at org.h2.command.dml.Insert.addRow(Insert.java:159)

at org.h2.command.dml.Select.queryFlat(Select.java:524)

at org.h2.command.dml.Select.queryWithoutCache(Select.java:618)

at org.h2.command.dml.Query.query(Query.java:307)

at org.h2.command.dml.Insert.insertRows(Insert.java:132)

at org.h2.command.dml.Insert.update(Insert.java:84)

at org.h2.command.ddl.CreateTable.update(CreateTable.java:181)

at org.h2.command.ddl.AlterTableAlterColumn.execute(AlterTableAlterColumn.java:432)

at org.h2.command.ddl.AlterTableAlterColumn.cloneTableStructure(AlterTableAlterColumn.java:332)

at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:214)

at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:138)

at org.h2.command.CommandContainer.update(CommandContainer.java:75)

at org.h2.command.Command.executeUpdate(Command.java:230)

at org.h2.command.CommandList.update(CommandList.java:41)

at org.h2.command.Command.executeUpdate(Command.java:230)

at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)

at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)

... 59 more

2012-11-12 13:08:50 org.apache.catalina.core.StandardContext start

严重: Error listenerStart



Reply | Threaded
Open this post in threaded view
|

RE: DB update error for H2

junoyoon
Administrator


It's because... I missed sth in the table alter.

<changeSet author="ngrinder.3.0-b3" id="5" dbms="h2">
<comment>Change missing h2 boolean type into char(1).</comment>
<sql splitStatements="false">
alter table nuser alter column enabled char(1) default 'T';
alter table nuser alter column is_external char(1) default 'F';
alter table agent alter column approved char(1);
alter table perf_test alter column stop_request char(1) default 'F';
alter table perf_test alter column send_mail char(1)  default 'F';
alter table perf_test alter column use_rampup char(1);
   </sql>
    </changeSet>

H2 save "TRUE" "FALSE" in the boolean type.
If you already have those record in your table... It might be fail to covert "TRUE" to "T"
I need to add the update query on this changeset.


JunHo Yoon
Global Platform Development Lab
/ Senior Engineer

13th FL., Bundang First Tower, 266-1, Seohyeon-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-824, KOREA
Tel 031-600-9071   Fax --   Mobile 010-6255-0559
Email  [hidden email]

NHN Business & Platform NAVER HANGAME 쥬니어네이버 해피빈 미투데이


-----Original Message-----
From: "Mavlarn [via ngrinder]"<[hidden email]>
To: "junoyoon"<[hidden email]>;
Cc:
Sent: 2012-11-12 (월) 14:19:58
Subject: DB update error for H2

Hi Juno,


I got an error during DB updtae for H2.


Today, I want to use local H2 DB to test, but it alwasy fail. The error message is as below.

From the message I noticed:"Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:"

And I also find the class "H2ExTypeConverter", which is overwrited by us to make the value of boolean type as "T" and "F". But from the log, it still get "TRUE".


And in DatabaseUpdater.init(), I found the code :

TypeConverterFactory.getInstance().register(H2ExTypeConverter.class);

It always register the type converter of H2. Is it proper to add this converter all the time?


2012-11-12 13:08:50 org.apache.catalina.core.StandardContext listenerStart

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseUpdater': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:728)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449)

at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4172)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4671)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)

at org.apache.catalina.startup.Catalina.start(Catalina.java:585)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseUpdater': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:135)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:400)

at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)

at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)

at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:103)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1475)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1443)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

... 25 more

Caused by: org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB

at org.ngrinder.infra.init.DatabaseUpdater.init(DatabaseUpdater.java:98)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)

at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)

... 44 more

Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set ngrinder_datachange_logfile/db.changelog_schema_H2_5.xml::5::ngrinder.3.0-b3:

     Reason: liquibase.exception.DatabaseException: Error executing SQL alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1);: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]:

          Caused By: Error executing SQL alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1);: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]:

          Caused By: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)

at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)

at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)

at org.ngrinder.infra.init.LiquibaseEx.update(LiquibaseEx.java:68)

at org.ngrinder.infra.init.DatabaseUpdater.init(DatabaseUpdater.java:96)

... 51 more

Caused by: liquibase.exception.DatabaseException: Error executing SQL alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1);: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)

at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)

at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075)

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)

... 55 more

Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column "ENABLED CHAR(1) DEFAULT 'T' NOT NULL": "'TRUE' (4)"; SQL statement:

alter table nuser alter column enabled char(1) default 'T';

alter table nuser alter column is_external char(1) default 'F';

alter table agent alter column approved char(1);

alter table perf_test alter column stop_request char(1) default 'F';

alter table perf_test alter column send_mail char(1)  default 'F';

alter table perf_test alter column use_rampup char(1); [22001-168]

at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)

at org.h2.message.DbException.get(DbException.java:169)

at org.h2.table.Column.validateConvertUpdateSequence(Column.java:315)

at org.h2.table.Table.validateConvertUpdateSequence(Table.java:689)

at org.h2.command.dml.Insert.addRow(Insert.java:159)

at org.h2.command.dml.Select.queryFlat(Select.java:524)

at org.h2.command.dml.Select.queryWithoutCache(Select.java:618)

at org.h2.command.dml.Query.query(Query.java:307)

at org.h2.command.dml.Insert.insertRows(Insert.java:132)

at org.h2.command.dml.Insert.update(Insert.java:84)

at org.h2.command.ddl.CreateTable.update(CreateTable.java:181)

at org.h2.command.ddl.AlterTableAlterColumn.execute(AlterTableAlterColumn.java:432)

at org.h2.command.ddl.AlterTableAlterColumn.cloneTableStructure(AlterTableAlterColumn.java:332)

at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:214)

at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:138)

at org.h2.command.CommandContainer.update(CommandContainer.java:75)

at org.h2.command.Command.executeUpdate(Command.java:230)

at org.h2.command.CommandList.update(CommandList.java:41)

at org.h2.command.Command.executeUpdate(Command.java:230)

at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)

at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)

... 59 more

2012-11-12 13:08:50 org.apache.catalina.core.StandardContext start

严重: Error listenerStart






If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/DB-update-error-for-H2-tp59.html
To start a new topic under ngrinder_dev, email [hidden email]
To unsubscribe from ngrinder_dev, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: DB update error for H2

tantan
In reply to this post by Mavlarn
how to add the update query on this changeset.