Stateful mode best practices struts/bc4j
445150Oct 19 2005 — edited Oct 20 2005When using Application modules in stateful mode in struts, is it still best practice to set the releasemode to stateless at the end of a unit of work so that the app module is released back into the pool?
I have experienced some weirdness in general with things like 'collisions' where it appears one user has 'stolen' another user's vo and I'm wondering if not ever changing the releasemode to stateless in a large app could account for this.
Here's how we use BC4J.
We always define the releasemode in the struts-config like this:
<action path="/bedtype" type="xxxxx">
<set-property property="viewobject" value="xxxView"/>
<set-property property="application" value="appModule"/>
<set-property property="releasemode" value="Stateful"/>
<set-property property="roles" value="Administrator"/>
<forward name="success" path="/WEB-INF/jsp/xxxx.jsp"/>
</action>
Then in the view object we'll get a handle on the vo either by calling context.getViewObject() where context is the BC4JContext or context.getApplicaitonModule().findViewObject("voname");
This works fine 90% of the time, however now and again the vo's tend to go a bit bonkers, where a vo will lose it's row set or other strange things.
So, is this the right way to work with BC4J? Should I be doing any special cleanup?