As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<tx:annotation-driven transaction-manager="transactionManager" mode="aspectj"/><br><br><task:annotation-driven/><br><br> <bean id="dataSource"<br> class="com.mchange.v2.c3p0.ComboPooledDataSource"><br> <property name="driverClass" value="${database.driver}" /><br> <property name="jdbcUrl" value="${database.url}" /><br> <property name="user" value="${database.username}" /><br> <property name="password" value="${database.password}" /><br> <property name="initialPoolSize" value="3" /><br> <property name="minPoolSize" value="1" /><br> <property name="maxPoolSize" value="17" /><br> </bean><br>…<br><bean id="transactionManager"<br> class="org.springframework.orm.hibernate3.HibernateTransactionManager"><br> <property name="dataSource" ref="dataSource" /><br> <property name="sessionFactory" ref="sessionFactory" /><br> </bean><br>…<br><bean<br> class="org.springframework.transaction.aspectj.AnnotationTransactionAspect"<br> factory-method="aspectOf"><br> <property name="transactionManager"><br> <ref local="transactionManager" /><br> </property><br> </bean><br>…<br><bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"><br> <property name="databaseType" value="postgres" /><br> <property name="dataSource" ref="dataSource" /><br> <property name="transactionManager" ref="transactionManager" /><br> <property name="history" value="full" /><br> <br> <property name="databaseSchemaUpdate" value="true" /> <br> <property name="jobExecutorActivate" value="true" /><br>…<br>
public class TestServiceTask implements JavaDelegate{<br><br> private VersionDAO versionDAO;<br><br> public TestServiceTask(){<br> versionDAO = new BeanAccessor().getBean(VersionDAO.class);<br> } <br> <br> public void execute(DelegateExecution execution) throws Exception {<br> Version version = versionDAO.loadDistributionVersion("Test");<br> }<br>}
@Transactional<br> public Version loadDistributionVersion(String productName) {<br> return (Version) getCurrentSession().createQuery("" +<br> "from Version as v " +<br> "where v.product.name = :smileytongue:roductName " +<br> "and v.product.distributionVersion.id = v.id")<br> .setParameter("productName", productName)<br> .uniqueResult();<br> }
public GenericDAO{<br> @Autowired<br> private SessionFactory sessionFactory;<br>…<br><br> protected Session getSession() {<br> return sessionFactory.getCurrentSession();<br> }<br>}
@Configurable<br>public class BeanAccessor {<br><br> @Autowired<br> private WebApplicationContext context;<br><br> public <T> T getBean(Class<T> beanClass) {<br> return context.getBean(beanClass);<br> }<br> <br> public <T> Map<String, T> getBeansOfType(Class<T> beanClass) {<br> return context.getBeansOfType(beanClass);<br> }<br>}
now working correctly with the Spring