2

I'm using activiti in my Spring Boot application: 'org.activiti:activiti-spring-boot-starter:7.1.0.M3.1'. By default, all activiti tables are contained in Spring Boot App database schema - Oracle 12.2 in my case. All activiti table names start with 'ACT_' prefix and all this tables and its indexes are in default 'USERS' tablespace.

Is it possible to specify additional prefix for activiti tables? For example I want to add 'FOO_' prefix to all activiti tables, then 'ACT_RE_MODEL' will be 'FOO_ACT_RE_MODEL'.

How can I specify tablespace 'INDX' to make activiti create indexes in different tablespace, not in 'USERS'?

antropoff
  • 111
  • 2
  • 3
  • 14

2 Answers2

2

If you are using Activiti 5 or 6 it uses MyBatis as the ORM. In order to update the standard table names and indexes, you will need to modify the mybatis mappings under activiti-engine/src/main/resources/org/activiti/db)

You will also need to update the create and drop sql files (under the same folder)

Obviously this will create an upgrade issue, but I'm sure you already appreciate that.

Greg Harley
  • 3,230
  • 1
  • 11
  • 14
  • Yes, the upgrade issue is obvious, so I won't modify MyBatis mappers. After your answer I've found two activiti params available in application.yml: 'custom-mybatis-mappers' and 'custom-mybatis-x-m-l-mappers'. May be, these params help me to rebuild indexes using 'INDX' tablespace? – antropoff Jun 04 '20 at 06:07
2

You probably don't want to use the USERS tablespace for anything related to your application. Instead of trying to customize the tablespace per-object, it's usually simpler to just set a default tablespace for the entire schema, like this:

alter user app_schema default tablespace schema_tablespace;
Jon Heller
  • 34,999
  • 6
  • 74
  • 132
  • I know, but we need to use USERS tablespace for tables and INDX tablespace for indexes. Administrator can specify tablespace name for indexes on app installation. – antropoff Jun 04 '20 at 05:11
  • 1
    But why do you need to use the USERS tablespace? That tablespace is often shared among many ad-hoc users and is likely to fill up from unexpected activity. Every organization I've worked for that cared about tablespace management would want applications to *not* use that tablespace. And using a separate tablespace for indexes is often a waste of time. There may be good reasons for both choices, I just want to check that you have good reasons and you're not looking to do things in a weird way just because "that's the way we've always done it." (But I know sometimes "it is what it is".) – Jon Heller Jun 04 '20 at 05:25
  • In our case: "so historically". My Spring Boot App is only one little module in a big System and there is a requirement to store app data not in its own DB, but in System-wide DB. Ok, I will definitely voice these questions to the project manager. – antropoff Jun 04 '20 at 05:49