Class AsyncSpringLiquibase
- java.lang.Object
-
- liquibase.integration.spring.SpringLiquibase
-
- io.github.jhipster.config.liquibase.AsyncSpringLiquibase
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ResourceLoaderAware
public class AsyncSpringLiquibase extends liquibase.integration.spring.SpringLiquibaseSpecific liquibase.integration.spring.SpringLiquibase that will update the database asynchronously.By default, this asynchronous version only works when using the "dev" profile.
The standard liquibase.integration.spring.SpringLiquibase starts Liquibase in the current thread:
- This is needed if you want to do some database requests at startup
- This ensure that the database is ready when the application starts
- On a recent MacBook Pro, start-up time is down from 14 seconds to 8 seconds
- In production, this can help your application run on platforms like Heroku, where it must start/restart very quickly
-
-
Field Summary
Fields Modifier and Type Field Description static StringDISABLED_MESSAGEstatic StringEXCEPTION_MESSAGEstatic StringSLOWNESS_MESSAGEstatic longSLOWNESS_THRESHOLDstatic StringSTARTED_MESSAGEstatic StringSTARTING_ASYNC_MESSAGEstatic StringSTARTING_SYNC_MESSAGE-
Fields inherited from class liquibase.integration.spring.SpringLiquibase
beanName, changeLog, contexts, databaseChangeLogLockTable, databaseChangeLogTable, dataSource, defaultSchema, dropFirst, labels, liquibaseSchema, liquibaseTablespace, log, parameters, resourceLoader, rollbackFile, shouldRun, tag, testRollbackOnUpdate
-
-
Constructor Summary
Constructors Constructor Description AsyncSpringLiquibase(Executor executor, org.springframework.core.env.Environment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidinitDb()-
Methods inherited from class liquibase.integration.spring.SpringLiquibase
createDatabase, createLiquibase, createResourceOpener, getBeanName, getChangeLog, getContexts, getDatabaseChangeLogLockTable, getDatabaseChangeLogTable, getDatabaseProductName, getDataSource, getDefaultSchema, getLabels, getLiquibaseSchema, getLiquibaseTablespace, getResourceLoader, getTag, isDropFirst, isIgnoreClasspathPrefix, isTestRollbackOnUpdate, performUpdate, setBeanName, setChangeLog, setChangeLogParameters, setContexts, setDatabaseChangeLogLockTable, setDatabaseChangeLogTable, setDataSource, setDefaultSchema, setDropFirst, setIgnoreClasspathPrefix, setLabels, setLiquibaseSchema, setLiquibaseTablespace, setResourceLoader, setRollbackFile, setShouldRun, setTag, setTestRollbackOnUpdate, toString
-
-
-
-
Field Detail
-
DISABLED_MESSAGE
public static final String DISABLED_MESSAGE
- See Also:
- Constant Field Values
-
STARTING_ASYNC_MESSAGE
public static final String STARTING_ASYNC_MESSAGE
- See Also:
- Constant Field Values
-
STARTING_SYNC_MESSAGE
public static final String STARTING_SYNC_MESSAGE
- See Also:
- Constant Field Values
-
STARTED_MESSAGE
public static final String STARTED_MESSAGE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE
public static final String EXCEPTION_MESSAGE
- See Also:
- Constant Field Values
-
SLOWNESS_THRESHOLD
public static final long SLOWNESS_THRESHOLD
- See Also:
- Constant Field Values
-
SLOWNESS_MESSAGE
public static final String SLOWNESS_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AsyncSpringLiquibase
public AsyncSpringLiquibase(Executor executor, org.springframework.core.env.Environment env)
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws liquibase.exception.LiquibaseException- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classliquibase.integration.spring.SpringLiquibase- Throws:
liquibase.exception.LiquibaseException
-
initDb
protected void initDb() throws liquibase.exception.LiquibaseException- Throws:
liquibase.exception.LiquibaseException
-
-