Skip to content

Commit 518dc8c

Browse files
committed
fix: change the event type that SqlSessionFactory is listening to
1 parent 531bd26 commit 518dc8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
* @see #setDataSource
8888
*/
8989
public class SqlSessionFactoryBean
90-
implements FactoryBean<SqlSessionFactory>, InitializingBean, ApplicationListener<ApplicationEvent> {
90+
implements FactoryBean<SqlSessionFactory>, InitializingBean, ApplicationListener<ContextRefreshedEvent> {
9191

9292
private static final Logger LOGGER = LoggerFactory.getLogger(SqlSessionFactoryBean.class);
9393

@@ -658,8 +658,8 @@ public boolean isSingleton() {
658658
* {@inheritDoc}
659659
*/
660660
@Override
661-
public void onApplicationEvent(ApplicationEvent event) {
662-
if (failFast && event instanceof ContextRefreshedEvent) {
661+
public void onApplicationEvent(ContextRefreshedEvent event) {
662+
if (failFast) {
663663
// fail-fast -> check all statements are completed
664664
this.sqlSessionFactory.getConfiguration().getMappedStatementNames();
665665
}

0 commit comments

Comments
 (0)