Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Component(service=UkelonnDatabase.class, immediate=true)
public class UkelonnDatabaseProvider implements UkelonnDatabase {
@Activate
public void activate() {
createDatasource();
UkelonnLiquibase liquibase = new UkelonnLiquibase();
try(Connection connect = getConnection()) {
try {
liquibase.createInitialSchema(connect);
insertMockData();
liquibase.updateSchema(connect);
} finally {
// Liquibase sets Connection.autoCommit to false, set it back to true
connect.setAutoCommit(true);
}
} catch (Exception e) {
logError("Failed to create derby test database schema", e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.