jbpm3的持久化实现基于hibernate3,由于与jboss的关系,估计以后要
采用ejb3方式的实现;而它目前的实现,与AgileFlow的方式基本类同:
1)JbpmSessionFactory
JbpmSessionFactory按顺序先后从下面的文件中读取hibernate.cfg.xml
的位置:
a)用户指定 buildDbSessionFactory(String configResource)
b)从jbpm.properties中指定
if (configResource==null) {
configResource = JbpmConfiguration.getString("jbpm.hibernate.cfg.xml");
}
c)按hibernate自己的处理方式:从classes目录下查找
JbpmSessionFactory封装了Configure和SessionFactory.
2)JbpmSession
JbpmSession封装了JbpmSessionFactory,Session,Transaction,这样可以在
JbpmSession中获取JbpmSessionFactory并产生其它的连接
AgileFlow只对外提供了两个方法:
1)AgileFlow.connectToServer();
它将产生Session,可能开始事务;在后面的代码中可以获取当前的连接.
2)AgileFlow.disConnectServer();
结束事务,关闭Session.
就对用户的方便性而言,我还是认为AgileFlow的实现要好些.
本文探讨了JBPM3使用Hibernate3进行持久化的实现方式,并将其与AgileFlow的连接管理机制进行了比较。JBPM3通过JbpmSessionFactory从多个位置加载配置,而AgileFlow提供更简便的连接和断开方法。
8595

被折叠的 条评论
为什么被折叠?



