What worries me is that sendPageAndWait provides an argument, which is reference to the cleanup function. AFAIU, this function should be invoked after page is sent. If you take a look at sendPageAndWait, it looks like:

FOM_Cocoon.prototype.sendPageAndWait = function(uri, bizData, fun, ttl) {
   this.sendPage(uri, bizData,
                 new FOM_WebContinuation(new Continuation(),
                                         this.continuation, ttl));
   if (fun) {
       if (!(fun instanceof Function)) {
           throw "Expected a function instead of: " + fun;
       }
       fun();
   }
   FOM_Cocoon.suicide();
}

So if you provide a function which closes connection, performs other cleanup actions, it should be invoked when view is generated. And this means, that sendPage returns execution control only when view is rendered already. Now, why this does not work or what I'm missing here?

Vadim


Leszek Gawron wrote:

Jeremy Quinn wrote:

Hi Guys,

catch (return) {session.close ()}

has worked fine when I needed it in the past.

What confused me about it was that the 'catch' statement is not paired with a 'try' or a 'finally' statement it sits by iteslf.

To be sure: does it also work with cocoon.sendPage() ?





Reply via email to