You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Bono, Chris" <ch...@zilliant.com> on 2001/07/24 21:32:52 UTC

chaining actions

I have two Actions chained together and my appserver is
throwing core dumps on me left and right if I issue too
many repeat requests.

Here are the mappings:

    <action path="/changeTree"
            type="com.yyy.zzz.ChangeTreeAction">
            <forward name="nextView"    path="/viewTree.do"/>                     
    </action>
                                        
    <action path="/viewTree"
            type="com.yyy.zzz.RetrieveTreeAction"
            scope="request"
            validate="false">
            <forward name="showTree"     path="/generic_treeview.jsp"/>
    </action>

So I have a jsp that shows a tree. When the user clicks on one
of the nodes, the /changeTree request is posted to the ActionServlet.
The ChangeTreeAction modifies the tree and then forwards onto the
RetrieveTreeAction which forwards back to the jsp view of the tree.

My actions use a TreeManager SFSB so I had to synchronize in order to
prevent multiple requests from hitting the same SFSB. If I issue too
many requests the app server crashes (threads are locking I believe).

The perform method in each of the Actions are synchronized. Since the
request flow is *always* from ChangeTreeAction to RetrieveTreeAction, I 
don't see how deadlock can be happening. 

NOTE: I thought maybe it was some of my code in the perform method so I
stubbed out both perform methods to only print a line to the console and
it is still happening. If I remove the synchronized blocks, it is all fine.



Is there a better way to chain actions?
Has anyone experienced anything similar?

Thanks,

Chris Bono
bonoc@zilliant.com
512.531.8518
http://www.zilliant.com