0 Replies Latest reply on Oct 16, 2009 9:12 AM by Edgar Vonk

    Row locks in Oracle after trying to delete a process instanc

    Edgar Vonk Newbie

      Hi,

      We have row locks in our Oracle 11g jBPM database. I am still trying to figure out what action causes these locks. What I have seen so far is that there is a blocking session in our database which performs this SQL:

      DELETE FROM jbpm4_execution WHERE dbid_ = :1 AND dbversion_ = :2


      It seems that this SQL statement hangs (no commit or rollback is ever done) causing other SQL statements (an update in this case) to block.

      I found the locked sessions using:
      select INST_ID, SID, TYPE, ID1, ID2, LMODE, REQUEST, CTIME, BLOCK from gv$lock where (ID1,ID2,TYPE) in (select ID1,ID2,TYPE from gv$lock where request>0);
      
      INST_ID SID TYPE ID1 ID2 LMODE REQUEST CTIME BLOCK
      1 139 TX 65548 37132 6 0 8804 1
      1 104 TX 65548 37132 0 6 7450 0
      


      When I look in our code I think the blocking database session must be our call to org.jbpm.api.ExecutionService#endProcessInstance.

      Does anyone have an idea why this could cause a lock?

      We use the default Oracle JDBC driver and our Hibernate settings are:
      <hibernate-configuration>
       <session-factory>
      
       <property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
       <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
       <property name="hibernate.connection.datasource">java:/JbpmDS</property>
       <property name="hibernate.format_sql">true</property>
      
       <mapping resource="jbpm.repository.hbm.xml" />
       <mapping resource="jbpm.execution.hbm.xml" />
       <mapping resource="jbpm.history.hbm.xml" />
       <mapping resource="jbpm.task.hbm.xml" />
       <mapping resource="jbpm.identity.hbm.xml" />
      
       </session-factory>
      </hibernate-configuration>
      


      cheers,

      Edgar