Skip to content

Conversation

@vpavic
Copy link
Contributor

@vpavic vpavic commented Jul 13, 2017

This commit updates database initializers configuration to enable them automatically only when an embedded DataSource is used. Related configuration properties have been updated to use a more expressive DatabaseInitializerMode enum rather than Boolean flag.

This resolves #8981.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 13, 2017
@snicoll snicoll self-requested a review July 14, 2017 08:22
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, I've added a few comments.

* @author Vedran Pavic
* @since 2.0.0
*/
public enum DatabaseInitializerMode {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at package tangle in details. Any reason why that's not in the jdbc package instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While choosing the target package for DatabaseInitializerMode it seemed to me that it would be natural to place it next to AbstractDatabaseInitializer which is in org.springframework.boot.autoconfigure. I'm not sure what's the best place for those two.


private final Initializer initializer = new Initializer();
/**
* Create the required Spring Integration tables on startup.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That javadoc should change to imply that there is a "mode"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will address that.


private final Initializer initializer = new Initializer();
/**
* Create the required Spring Session tables on startup.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That removes silently a feature isn't it? It's probably for the better but I just want to double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, not sure what exactly you refer to by removes silently a feature, but that part is basically alignment with what you did with Quartz JDBC properties.

This commit updates database initializers configuration to enable them automatically only when an embedded `DataSource` is used. Related configuration properties have been updated to use a more expressive `DatabaseInitializerMode` enum rather than `Boolean` flag.
@vpavic
Copy link
Contributor Author

vpavic commented Jul 28, 2017

Thanks for the feedback @snicoll - I've addressed the javadoc related suggestion.

@snicoll snicoll self-assigned this Aug 12, 2017
snicoll pushed a commit that referenced this pull request Aug 18, 2017
This commit updates database initializers configuration to enable them
automatically only when an embedded `DataSource` is used. Related
configuration properties have been updated to use a more expressive
`DatabaseInitializerMode` enum rather than `Boolean` flag.

See gh-9752
@snicoll snicoll closed this in 394371e Aug 18, 2017
snicoll added a commit that referenced this pull request Aug 18, 2017
* pr/9752:
  Polish "Harmonize database initializers"
  Harmonize database initializers
@vpavic vpavic deleted the gh-8981 branch August 18, 2017 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable database initializers when an embedded database is detected

3 participants