cancel
Showing results for 
Search instead for 
Did you mean: 

Database view page is empty (Oracle)

alexander1
Champ in-the-making
Champ in-the-making
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
5 REPLIES 5

pneudecorb
Champ in-the-making
Champ in-the-making
I am running into the same problem when I connect to Oracle and run the demo.

I am evaluating Activiti for my company and not sure this would be a problem in a production environment, but is it something that the development team is willing to address in a patch?

Thanks.

tomili
Champ in-the-making
Champ in-the-making
Hi,

I had the same problem when I started activity 5.9 demo on my Oracle Database XE 11.2.
But in this database I had two different schemas for Activity (users and tables) for version 5.8 and 5.9
When the old tables was deleted - it works fine.

Best regards,
tomili

cboehnke
Champ in-the-making
Champ in-the-making
Same problem here - Please can you fix this?

activiti-5.9/setup/files/dependencies/libs/org/activity/activiti-engine-5.9-sources.jar:
engine/impl/persistence/entity/TableDataManager.java:         

2 fixes:
  1. Escape the '\':  …. where table_name like 'ACT\_%' ESCAPE '\';
  2. Look at user_tables instead of all_tables.

Please?

frederikherema1
Star Contributor
Star Contributor
Can you create a JIRA-issue with the proposed solution elaborated a bit more? That would be great…

cboehnke
Champ in-the-making
Champ in-the-making
Can you create a JIRA-issue with the proposed solution elaborated a bit more? That would be great…

Good idea. Created http://jira.codehaus.org/browse/ACT-1404 , heavily quoting Alexander's excellent findings above.

- Christian