Instantiate Activiti when database is down.

cancel
Showing results for 
Search instead for 
Did you mean: 
gjaya26
Member II

Instantiate Activiti when database is down.

Hi,

We are using activiti 5.22. We have a spring application which uses activiti apis. We have the following in our xml configuration:

<bean id="processEngineConfiguration" class="com.pru.wf.engine.extension.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />

...

<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="true" />
<property name="enableDatabaseEventLogging" value="true" />

</bean>

SpringProcessEngineConfiguration extends org.activiti.spring.SpringProcessEngineConfiguration

We would like to bring up our application when the database is down.

We tried the above xml config with lazy-init="true". But we get the following exception:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.activiti.engi
ne.ActivitiException: couldn't check if tables are already present using metadata: weblogic.common.resourcepool.ResourceDeadException: 0:weblogic.common.ResourceException: Could not create pool connec
tion for datasource 'WFEngine'.

Caused by: org.activiti.engine.ActivitiException: couldn't check if tables are already present using metadata: weblogic.common.resourcepool.ResourceDeadException: 0:weblogic.common.ResourceException:
Could not create pool connection for datasource 'WFEngine'.

Is there any way to lazy initialize process engine beans using xml? What options are available?

1 Reply
ryandawson
Alfresco Employee

Re: Instantiate Activiti when database is down.

I don't see any way to do it without changing the code or implementing your own persistence layer using the v6 pluggable persistence feature - see Activiti/DbSqlSession.java at 126e89911d49c6ec0ab3f222baeea2a256e24c0d · Activiti/Activiti · GitHub  , https://github.com/Activiti/Activiti/blob/ac55f68fae3d3518313eda7fa992293b41ff8e6e/activiti-engine/s... - , Create Activiti process engine without h2 or any database and Activiti without using database? 

Perhaps using an in-memory database for activiti would satisfy what you're looking to do?