Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable database initializers when an embedded database is detected #8981

Closed
snicoll opened this issue Apr 24, 2017 · 7 comments
Closed

Enable database initializers when an embedded database is detected #8981

snicoll opened this issue Apr 24, 2017 · 7 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@snicoll
Copy link
Member

snicoll commented Apr 24, 2017

We currently expose database initializers for Spring Batch, Spring Session and Spring Integration JDBC. While the first two are mandatory, the latter is only really required if you start using some of the features.

While working on #8881, we realized that having them enabled by default can be a bit nasty (especially for Spring Integration) so it is disabled now by default.

I think the other two should probably have a mode. Or they should only be enabled automatically if an embedded datasource is detected.

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Apr 24, 2017
@vpavic
Copy link
Contributor

vpavic commented Apr 25, 2017

Even though automatically enabled database initializers are helpful to get things up and running quickly I agree that this is somewhat nasty and not desirable in serious environments where you'd want to be explicit and fully in control of schema creation. IMO Spring Boot defaults should align with that approach.

Enabling database initializers for an embedded datasource sounds nice and it's also consistent with approach used for spring.jpa.hibernate.ddl-auto, where create-drop will be used for embedded and none otherwise.

@snicoll snicoll added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Apr 27, 2017
@snicoll snicoll added this to the 2.0.0.M2 milestone Apr 27, 2017
@snicoll snicoll changed the title Harmonize database initializers Enable database initializers when an embedded database is detected Apr 27, 2017
@snicoll
Copy link
Member Author

snicoll commented Apr 27, 2017

Let's reuse the code we use for Hibernate's ddl-auto flag. And perhaps we should use an enum rather than an enum? (ALWAYS, EMBEDDED, NEVER).

@philwebb
Copy link
Member

philwebb commented May 1, 2017

See also #9048 for another initializer bug.

@snicoll
Copy link
Member Author

snicoll commented May 2, 2017

@philwebb any reason you linked that issue to this one? I don't get how they are related.

@philwebb
Copy link
Member

philwebb commented May 3, 2017

@snicoll I just linked them so we're aware that we'll likely need to touch that code for another reason as well. I thought it might effect the design.

@snicoll
Copy link
Member Author

snicoll commented Jun 1, 2017

Also, I think we should revisit the initializr.enabled part. The schema attribute in the parent namespace feels really weird. I took a different approach with Quartz with initialize-schema at the same level. I think we should go that route for others as well.

@philwebb philwebb modified the milestones: 2.0.0.M2, 2.0.0.M3 Jun 3, 2017
@snicoll snicoll modified the milestones: 2.0.0.M4, 2.0.0.M3 Jul 24, 2017
@snicoll
Copy link
Member Author

snicoll commented Jul 26, 2017

Closing in favour of PR #9752

@snicoll snicoll closed this as completed Jul 26, 2017
@snicoll snicoll removed the type: enhancement A general enhancement label Jul 26, 2017
@snicoll snicoll removed this from the 2.0.0.M4 milestone Jul 26, 2017
@snicoll snicoll added the status: duplicate A duplicate of another issue label Jul 26, 2017
snicoll added a commit that referenced this issue Aug 18, 2017
* pr/9752:
  Polish "Harmonize database initializers"
  Harmonize database initializers
@philwebb philwebb added status: superseded An issue that has been superseded by another and removed status: duplicate A duplicate of another issue labels Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants