I’m using a shared process engine (defined in Tomcat’s server.xml) in a Spring application.
My @Configuration is straight forward:
@Bean public ProcessEngine processEngine(ProcessEngineService processEngineService) { return processEngineService.getDefaultProcessEngine(); }
@Bean public RepositoryService repositoryService(ProcessEngine processEngine) { return processEngine.getRepositoryService(); }
Now, the problem is that ProcessEngine.close() is being called when the Spring ApplicationContext is being closed!
That means my Process-Application is shutting down the globally shared process engine!
I’ve found a way to avoid that behavoir by setting @Bean(destroyMethod = StringUtils.EMPTY) for processEngine(), but I wanted to make sure if there is another approach or if my configuration is wrong.
This topic may be related:
There, a difference in behavoir between Spring 3 and 4 was mentioned.
And in deed, Spring’s DisposableBeanAdapter calls close() for a bean that does not implement DisposableBean since 3.2: