cancel
Showing results for 
Search instead for 
Did you mean: 

How we can manage TableSpace with Oracle for activiti

dharamjeet
Confirmed Champ
Confirmed Champ

I need to know how we can manage tablespace with oracle db  as database for activiti enterpirse. I found we have no way to configure in activiti.

1 ACCEPTED ANSWER

Yes It worked. This is what I did.

Thank you very much.

@Bean
 public BeanPostProcessor activitiConfigurer() {
  return new BeanPostProcessor() {
   @Override
   public Object postProcessBeforeInitialization(Object bean, String beanName) {
    if (bean instanceof SpringProcessEngineConfiguration) {
     ((SpringProcessEngineConfiguration) bean).setActivityBehaviorFactory(rcActivitiBehaviourFactory);
     ((SpringProcessEngineConfiguration) bean).setDatabaseSchema("orcl");
    }
    return bean;
   }
   @Override
   public Object postProcessAfterInitialization(Object bean, String beanName) {
    return bean;
   }
  };
 }

View answer in original post

8 REPLIES 8

daisuke-yoshimo
Star Collaborator
Star Collaborator

Thank you for your all stack trace and I understood the cause.


But, if you use activiti-explorer, it is difficult to resolve the problem.

If you use directly activiti-engine, you can use setDatabaseSchema(String databaseSchema).
If you use activiti-explorer, you cannot set databaseSchema.
https://www.activiti.org/javadocs/org/activiti/engine/ProcessEngineConfiguration.html#databaseSchema

If you use activiti-explorer and want to resolve this problem, you limit the user's(test2) authority, not use dba permissions.

The cause
Activiti engine check which the table already exists in the database by using your datasource setting.
Your datasource setting contains dba permissions and activiti engine can get information on tables of other schemas and mistakenly judge that the table has already been created.

If you set datasource and schema, activiti engine can get information on tables of only your schema and don't mistakenly judge.

daisuke-yoshimo
Star Collaborator
Star Collaborator

> If you use activiti-explorer, you cannot set databaseSchema.

Perhaps, you can specify the schema by changing the following settings.
activiti-rest/WEB-INF/classes/META-INF/activiti-rest/activiti-custom-context.xml

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">

<property name="databaseSchema" ref="test2" />
<property name="dataSource" ref="dataSource" />

<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="mailServerHost" value="localhost" />
<property name="mailServerPort" value="5025" />
<property name="historyLevel" value="full" />
<property name="jobExecutorActivate" value="false" />
<property name="asyncExecutorEnabled" value="false" />
<property name="asyncExecutorActivate" value="false" />
</bean>

Or, you may resolve to set schemaUpdate setting as false.
activiti-rest/WEB-INF/classes/META-INF/activiti-rest/engine.properties
engine.schema.update=true

Yes It worked. This is what I did.

Thank you very much.

@Bean
 public BeanPostProcessor activitiConfigurer() {
  return new BeanPostProcessor() {
   @Override
   public Object postProcessBeforeInitialization(Object bean, String beanName) {
    if (bean instanceof SpringProcessEngineConfiguration) {
     ((SpringProcessEngineConfiguration) bean).setActivityBehaviorFactory(rcActivitiBehaviourFactory);
     ((SpringProcessEngineConfiguration) bean).setDatabaseSchema("orcl");
    }
    return bean;
   }
   @Override
   public Object postProcessAfterInitialization(Object bean, String beanName) {
    return bean;
   }
  };
 }

thanks daisuke-yoshimoto, I am using enterprise version so I changed it through java configuration and it worked for me.

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.