持久化VariableInstance 报错

报错:

2010-03-10 17:37:52,953ERROR GraphElement.executeAction(270)-action threw exception: instance not of expected entity type: org.jbpm.context.exe.variableinstance.UnpersistableInstance is not a: org.jbpm.context.exe.VariableInstance
org.hibernate.HibernateException: instance not of expected entity type: org.jbpm.context.exe.variableinstance.UnpersistableInstance is not a: org.jbpm.context.exe.VariableInstance
at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3583)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1347)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)
at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:487)

2010-03-10 17:37:52,984ERROR LazyInitializationException.<init>(19)-failed to lazily initialize a collection of role: org.jbpm.graph.def.Node.exceptionHandlers, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.graph.def.Node.exceptionHandlers, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentList.iterator(PersistentList.java:115)

 

问题解决了,这个问题是由于jbpm变量引起的。
在jbpm3.2版本中,它将所有的变量是要入库的,上面的错误是由于在这些变量中存在没有序列化的,不是数据类型不是基础类型。
解决方法:当不需要入库的内容用瞬时变量(setTransientVariable)来定义,原先我用的是setVariable(),这样这个变量只在流程流转过程中有效,不入库,自然就不会报错了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值