cancel
Showing results for 
Search instead for 
Did you mean: 

Schema creation with JTA and Oracle database

wismax
Champ in-the-making
Champ in-the-making
Hello,

We are facing an issue during schema creation at the first Activiti startup. We are using Activiti inside a Spring application using an embedded Jencks/Geronimo JTA transaction manager which connect to an Oracle 11g database instance.

During schema creation, we have the following exception thrown by Activiti:

2011-09-07 16:56:18,676 [           main] ERROR [                            o.a.e.i.d.DbSqlSession] problem during schema create, statement 'create table ACT_GE_PROPERTY (
NAME_ NVARCHAR2(64),
VALUE_ NVARCHAR2(300),
REV_ INTEGER,
primary key (NAME_)
)
java.sql.SQLSyntaxErrorException: ORA-02089: COMMIT is not allowed in a subordinate session

   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
   at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
   at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
   at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
   at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
   at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
   at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1000)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
   at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1882)
   at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1847)
   at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:301)
   at org.tranql.connector.jdbc.StatementHandle.execute(StatementHandle.java:121)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:800)

What happens is the following:
  • we have configured activiti to use the jta transaction using this spring bean
  •     
        <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
            <property name="databaseType" value="${activiti.datasource.databasetype}" />
            <property name="dataSource" ref="dataSource" />
            <property name="transactionManager" ref="transactionManager" />
            <property name="transactionsExternallyManaged" value="true"/>
            <property name="databaseSchemaUpdate" value="true" />
            <property name="jobExecutorActivate" value="false" />
        </bean>

  • at startup activiti wants to create the schema

  • a new JTA transaction is started

  • the DDL statements are always executed in autocommit by Oracle

  • so the exception is thrown
My question is: is there a way to tell activity to not participate in JTA transaction for the schema creation/update part ?

Thx for your help !
2 REPLIES 2

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I think there is a Jira issue already for this.

heymjo
Champ on-the-rise
Champ on-the-rise
same thing with Atomikos XA datasources see here http://forums.activiti.org/en/viewtopic.php?f=6&t=1869