<environment-definition>
  <environment-factory>
    <properties name="orchestra-properties" resource="orchestra.properties"/>
    <hibernate-configuration name="hibernate-configuration:core">
      <properties resource="hibernate.properties"/>
      <mappings resource="hibernate/bpel.core.mappings.xml"/>
      <cache-configuration resource="hibernate/bpel.cache.definition.xml" usage="nonstrict-read-write"/>
      <!-- cache-configuration for runtime data. Must be used with a replicated cache when used in cluster -->
      <!-- <cache-configuration resource='hibernate/bpel.cache.runtime.xml' usage='read-write' /> -->
    </hibernate-configuration>
    <hibernate-session-factory configuration="hibernate-configuration:core" init="eager" name="hibernate-session-factory:core"/>
    <command-service>
      <orchestra-retry-interceptor delay="100" delay-factor="4" max-delay="10000" retries="10"/>
      <environment-interceptor/>
      <standard-transaction-interceptor/>
    </command-service>
    <invoke-executor threads="10"/>
    <job-executor auto-start="false" limit-job-per-instance="false" lock="180000" threads="10"/>
    <hibernate-configuration name="hibernate-configuration:journal">
      <properties resource="hibernate-journal.properties"/>
      <mappings resource="hibernate/bpel.monitoring.mappings.xml"/>
      <mapping resource="hibernate/bpel.util.hbm.xml"/>
    </hibernate-configuration>
    <hibernate-session-factory configuration="hibernate-configuration:journal" init="eager" name="hibernate-session-factory:journal"/>
    <dead-job-handler class="org.ow2.orchestra.services.handlers.impl.ExitInstanceDeadJobHandler"/>
    <repository class="org.ow2.orchestra.services.impl.DbRepository"/>
    <publisher class="org.ow2.orchestra.axis.AxisPublisher"/>
    <invoker class="org.ow2.orchestra.services.impl.SOAPInvoker" name="serviceInvoker"/>
  </environment-factory>
  <environment>
    <hibernate-session factory="hibernate-session-factory:core" name="hibernate-session:core"/>
    <runtime-db-session name="runtime-session:core" session="hibernate-session:core"/>
    <transaction/>
    <timer-session retries="50"/>
    <message-session retries="50" use-fair-scheduling="false"/>
    <job-db-session session="hibernate-session:core"/>
    <hibernate-session factory="hibernate-session-factory:journal" name="hibernate-session:journal"/>
    <querier-db-session name="querier-session:journal" session="hibernate-session:journal"/>
    <journal class="org.ow2.orchestra.persistence.db.DbJournal" name="journal">
      <arg>
        <ref object="querier-session:journal"/>
      </arg>
    </journal>
    <chainer name="recorder">
      <recorder class="org.ow2.orchestra.persistence.log.LoggerRecorder"/>
      <ref object="journal"/>
    </chainer>
    <chainer name="archiver">
      <archiver class="org.ow2.orchestra.persistence.log.LoggerArchiver"/>
    </chainer>
    <queryApi name="queryList">
      <ref object="journal"/>
    </queryApi>
    <chainer name="finished-instance-handler">
      <finished-instance-handler class="org.ow2.orchestra.services.handlers.impl.DeleteFinishedInstanceHandler"/>
    </chainer>
    <chainer name="undeployed-process-handler">
      <undeployed-process-handler class="org.ow2.orchestra.services.handlers.impl.NoOpUndeployedProcessHandler"/>
    </chainer>
  </environment>
</environment-definition>
