What is the significance of Flyway in Spring Boot?
Flyway applies versioned SQL migrations once and in order, so every environment has the same schema. See setup, naming rules and safe practices in Spring Boot.
2,887 posts about Java: questions with answers, tutorials and articles, newest first.
Flyway applies versioned SQL migrations once and in order, so every environment has the same schema. See setup, naming rules and safe practices in Spring Boot.
@ConfigurationProperties binds datasource and pool settings to beans, which makes multiple databases easy. Learn Hikari bindings, jdbc-url and @Primary.
Configure a HikariCP connection pool in a plain Spring application, wire it into JdbcTemplate and transactions, and size and monitor it correctly.
The Java DataSource interface abstracts how JDBC connections are created, enabling pooling, JNDI lookup and XA transactions, and replacing DriverManager in real applications.
Set spring.datasource properties, tune HikariCP, define DataSource beans in Java and configure multiple databases in a Spring Boot application.
PlatformTransactionManager is Spring's core transaction abstraction. It starts, commits and rolls back transactions for JDBC, JPA or JTA, behind @Transactional and TransactionTemplate.
Annotate service methods with @Transactional and Spring begins, commits and rolls back for you. Learn the attributes, rollback defaults and common pitfalls.
@Transactional is Spring's declarative layer; JTA is the standard for distributed transactions. Learn how they relate and when you really need JTA.
Run Spring event listeners off the publisher thread with @Async and @EventListener, and learn executors, exceptions, and transaction timing.
@EventListener turns a Spring bean method into an event handler, so components react to published events without implementing ApplicationListener.
Define a custom event as a record, publish it with ApplicationEventPublisher, and handle it with @EventListener. Includes async, transactional and test examples.
ApplicationEvent is the base class for Spring in-process events. See how to publish custom events, use @EventListener and handle container lifecycle events.
Publish custom events with ApplicationEventPublisher and react to them with @EventListener, async listeners and transaction-aware listeners.
@ComponentScan tells Spring which packages to search for stereotype beans. Learn its attributes, filters and how Spring Boot applies it by default.
See how to load Spring configuration from XML using ClassPathXmlApplicationContext and related classes, wire beans, and reuse XML in Spring Boot.
Compare the Spring ApplicationContext implementations, from annotation and XML contexts to web and reactive contexts, and see when to use each.
Use @PreDestroy, DisposableBean or destroyMethod to release resources when a Spring bean is destroyed, with callback order and common pitfalls.
@PreDestroy marks a cleanup method that Spring calls before a bean is destroyed. See when it runs, the jakarta import, ordering with DisposableBean, and common pitfalls.
@PostConstruct marks a method that runs once after a bean is constructed and its dependencies are injected. Learn the lifecycle, jakarta package and alternatives.
Create a custom Spring bean scope by implementing the Scope interface, registering it with CustomScopeConfigurer, and using scoped proxies for singleton injection.