11-18-2011 07:07 AM
@Transactional
public void transactionalMethod(){
runtimeService.deleteProcessInstance(id, "");
entityDao.delete(daoInstance); //<———- this will throw an exception
}
<!– ANNOTAZIONI –>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<!– DATASOURCE E JPA/HIBERNATE –>
<jee:jndi-lookup id="dataSource" jndi-name="java:jdbc/cqds" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="ControlloQualitaPU" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!– enable the configuration of transactional behavior based on annotations –>
<tx:annotation-driven transaction-manager="transactionManager" />
<!– Activiti –>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="deploymentResources"
value="classpath*:it/ipzs/iol/cq/process/autodeploy.*.bpmn20.xml" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="true" />
<property name="history" value="full" />
<!– JPA –>
<property name="jpaEntityManagerFactory" ref="entityManagerFactory" />
<property name="jpaHandleTransaction" value="true" /> <!– yet tested with false –>
<property name="jpaCloseEntityManager" value="true" /> <!– yet tested with false –>
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine"
factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine"
factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine"
factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine"
factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine"
factory-method="getManagementService" />
<bean id="formService" factory-bean="processEngine"
factory-method="getFormService" />
11-18-2011 07:17 AM
11-18-2011 09:47 AM
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="ControlloQualitaPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:jdbc/cqds</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.archive.autodetection" value="class, hbm" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.query.substitutions" value="true 1, false 0" />
</properties>
</persistence-unit>
</persistence>
11-21-2011 06:43 AM
12-05-2011 06:47 AM
<property name="jpaHandleTransaction" value="true" /> <!– yet tested with false –>
<property name="jpaCloseEntityManager" value="true" /> <!– yet tested with false –>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.