Spring Integration

You need a JTA transaction manager. Thus either run in an application server or use JOTM, like described below.

Example application context xml

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="resourceRef">
            <value>true</value>
        </property>
        <property name="jndiName">
            <value>jdbc/oracle</value>
        </property>
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="mappingResources">
            <value>${hibernate.mappings}</value>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</prop>
                <prop key="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.JOTMTransactionManagerLookup</prop>
                <prop key="jta.UserTransaction">java:comp/UserTransaction</prop>
            </props>
        </property>
        <property name="schemaUpdate">
            <value>false</value>
        </property>
    </bean>

    <bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean"/>

    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="userTransaction">
            <ref local="jotm"/>
        </property>
    </bean>

    <bean id="approvalProcess" class="org.concern.controller.spring.ControllerFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</prop>
                <prop key="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.JOTMTransactionManagerLookup</prop>
                <prop key="jta.UserTransaction">java:comp/UserTransaction</prop>
            </props>
        </property>
        <property name="schemaUpdate">
            <value>none</value>
        </property>
        <property name="processJarLocation">
            <value>/approval-process.jar</value>
        </property>
        <property name="resources">
            <map>
                <entry key="sessionFactory">
                    <ref bean="sessionFactory"/>
                </entry>
            </map>
        </property>
    </bean>

    <bean id="approvalLoader" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject"><ref local='approvalProcess'/></property>
        <property name="targetMethod"><value>getLoader</value></property>
    </bean>

    <bean id="approvalWorklist" class="org.concern.controller.spring.WorklistFactoryBean">
        <property name="name">
            <value>Approval Worklist</value>
        </property>
        <property name="controller">
            <ref bean="approvalProcess"/>
        </property>
        <property name="loader">
            <ref bean="approvalLoader"/>
        </property>
        <property name="activities">
            <list>
                <value>ExternalAdvertising</value>
                <value>InternalAdvertising</value>
            </list>
        </property>
    </bean>

Further configuration

Please consult the api documentation of the package org.concern.controller.spring to learn more about available configuration options.