Back Forum Reply New

How to implement PersistenceContext in SWF 2 RC1

Hi,

I am trying to use a persistence context in both a parent and subflow.
When entering the subflow I get the following:

java.lang.IllegalStateException: Already value [org..orm.hibernate3.SessionHolder@1  254e59] for key [org.hibernate.impl.SessionFactoryImpl@56b64c] bound to thread [from-8084-4]
org..transaction.support.Transactio  nSynchronizationManager.bindResource(TransactionSy  nchronizationManager.java:169)
org..webflow.persistence.HibernateF  lowExecutionListener.bind(HibernateFlowExecutionLi  stener.java:173)
org..webflow.persistence.HibernateF  lowExecutionListener.sessionStarting(HibernateFlow  ExecutionListener.java:110)
org..webflow.engine.impl.FlowExecut  ionListeners.fireSessionStarting(FlowExecutionList  eners.java:117)
org..webflow.engine.impl.FlowExecut  ionImpl.start(FlowExecutionImpl.java:359)
org..webflow.engine.impl.RequestCon  trolContextImpl.start(RequestControlContextImpl.ja  va:229)
org..webflow.engine.SubflowState.do  Enter(SubflowState.java:101)
org..webflow.engine.State.enter(Sta  te.java:193)
org..webflow.engine.Transition.exec  ute(Transition.java:222)

I guess that webflow is trying to bind a persistence context while there is already one available. I am having this problem for longer than a month and still haven't found a solution.
According to the ref guide there is also a ConversationScoped PersistenceContext pattern. I think this should make the the persistence context available for subflows.
The ref guide however doesn't tell me how this is implemented.
Any suggestions?

Hi Ivan,

This appears to be a bug in the persistence listener when working with subflows (HibernateFlowExecutionListener in this case).  When the subflow is started the suspending parent should take care to unbind the session, but this is not being done.  Can you create a JIRA? We'll fix this promptly and you can grab the fix in a nightly build.

Thanks

Keith

This issue has been resolved in browse/SWF-600.

If you can confirm in the next nightly build this resolution works for you in your environment that would be great!

Thanks Keith,

I confirm that it finally works now. Great Job!!
¥
Back Forum Reply New