读书人

osworkflow配置有关问题(主要是proper

发布时间: 2012-11-08 08:48:12 作者: rapoo

osworkflow配置问题(主要是propertyset的事务配置spring2方式)
看了陈刚写的osworkflow开发指南和工作手册,下载了osworkflow_bundle2,按同样的方法搭建好了平台

写了一个简单的请假流程,测试正常

环境:Hibernate3.2+spring2.0+struts2.0+osworkflow2.8

但是:只要osworkflow流程配置中有使用 beanshell 就会出现错误

我是采用 aspectJ的配置方式 配置事务管理,现在就是这里spring中事务配置会出错,而陈刚的文档中是采用spring1.0的配置方式

web.xml我配置了opensessioninview

出错部分
<bean id="sessionFactory" ref="dataSource" /> <property name="lobHandler" ref="oracleLobHandler" /> <property name="hibernateProperties" ref="hibernateProperties" /> <property name="annotatedClasses"> <list> <value>com.zy.model.Announces</value> </list> </property> <!-- property name="mappingDirectoryLocations" --> <property name="mappingResources"> <list> <value>com/opensymphony/workflow/spi/hibernate3/HibernateCurrentStep.hbm.xml</value> <value>com/opensymphony/workflow/spi/hibernate3/HibernateCurrentStepPrev.hbm.xml</value> <value>com/opensymphony/workflow/spi/hibernate3/HibernateHistoryStep.hbm.xml</value> <value>com/opensymphony/workflow/spi/hibernate3/HibernateHistoryStepPrev.hbm.xml</value> <value>com/opensymphony/workflow/spi/hibernate3/HibernateWorkflowEntry.hbm.xml</value> <value>com/opensymphony/module/propertyset/hibernate3/PropertySetItem.hbm.xml</value> </list> </property> </bean> <!-- =========定义事务拦截器(aspectJ的配置方式)====================================================== --> <tx:annotation-driven /> <aop:aspectj-autoproxy/> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="get*" read-only="true" /> <tx:method name="find*" read-only="true" /> <tx:method name="load*" read-only="true" /> <tx:method name="save*" /> <tx:method name="create*" /> <tx:method name="remove*" /> <tx:method name="update*" /> <tx:method name="del*" /> <tx:method name="set*" /> <tx:method name="*" /> </tx:attributes> </tx:advice> <aop:config proxy-target-/> <aop:advisor pointcut="execution(* com.zy.service.*Service.*(..))" advice-ref="txAdvice" /> <aop:advisor pointcut="execution(* com.opensymphony.module.propertyset.hibernate3.*.*(..))" advice-ref="txAdvice" /> </aop:config> <!-- osworkflow --> <bean id="propertySetDelegate" init-method="init"> <property name="resource"> <value>workflowdef/workflows.xml</value> </property> <property name="reload"><value>true</value></property> </bean> <bean id="workflowConfiguration" ref="sessionFactory"/> </bean> <!-- End WorkFlow -->
public class OpenSessionInViewFilter extends org.springframework.orm.hibernate3.support.OpenSessionInViewFilter { /** * we do a different flushmode than in the codebase * here */ protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException { Session session = SessionFactoryUtils.getSession(sessionFactory, true); session.setFlushMode(FlushMode.COMMIT); return session; } /** * we do an explicit flush here just in case * we do not have an automated flush */ protected void closeSession(Session session, SessionFactory factory) { session.flush(); super.closeSession(session, factory); }}

读书人网 >操作系统

热点推荐