AnsweredAssumed Answered

Database view page is empty (Oracle)

Question asked by alexander1 on Mar 30, 2012
Latest reply on Oct 10, 2012 by cboehnke
Dear Users,
I have a problem in Activiti Explorer. Database view page is empty when activiti engine 5.9 is running on Oracle database 10.
I have an mistake:
com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: couldn't get table counts
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)

I have discovered that in the Activiti Engine exist a class called TableDataManager.It's method getTableCount() trows this exception at the moment it tryes to run getTablesPresentInDatabase() method which has code:
  try {
        log.fine("retrieving activiti tables from jdbc metadata");
        String tableNameFilter = "ACT_%";
        if ("postgres".equals(getDbSqlSession().getDbSqlSessionFactory().getDatabaseType())) {
          tableNameFilter = "act_%";
        }
        tables = databaseMetaData.getTables(null, null, tableNameFilter, getDbSqlSession().JDBC_METADATA_TABLE_TYPES);
Underscore is a symbol of Oracle grammar.I've tryed to run simple SQL on my database:
select *
FROM all_tables
WHERE  TABLE_NAME LIKE  'ACT_%'
It returns not only tables which starts with  ACT_ but also other tables which starts with act.
I find that if i modify SQL to
select *
FROM all_tables
WHERE  TABLE_NAME LIKE  'ACT_\%' ESCAPE '\'
It returns only ACT tables as it should.
You already have special tableNameFilter for "postgres"
 
if ("postgres".equals(getDbSqlSession().getDbSqlSessionFactory().getDatabaseType())) {
tableNameFilter = "act_%";
}
Is it possible to introduce special logic for Oracle like
if ("oracle".equals(getDbSqlSession().getDbSqlSessionFactory().getDatabaseType())) {
tableNameFilter = "ACT_\% ESCAPE '\' ";
}
Or do you have any other suggestion how to solve with issue?
Maybe it would be better to create a JIRA, but anyway i've decided to ask first at forum.
Thanks,
Alexander

Outcomes