cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Switching rhino implementation
Date Tue, 02 Nov 2004 11:25:11 GMT
Reinhard Poetz wrote:
> Leszek Gawron wrote:
> 
>> Reinhard Poetz wrote:
>>
>>> Thank you guys.
>>>
>>> I'm going to replace the old implementation by the new one in trunk. 
>>> In branch I will wait for the new release and rename the old language 
>>> "javascript-2.1.6" which indicates that this is the former 
>>> implementation. The new implementation will be called "javascript". 
>>> This way most of our users will switch to the new implementation 
>>> without noticing it. If they have problems they can either rewrite 
>>> their catch() statements or change the language to "javascript-2.1.6".
>>>
>> Is there any replacement for catch() functionality in new implementation?
>>
> 
> Igor explains the differences here: 
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=109528520325331&w=2
> 
Thank you. From what I see in this mail new implementation still allows for 
cleanup code after continuation has been created but does not allow for 
automatic resource fetching ( catch( continue ) ).

<quote>
var pool = ...;

function someFunction() {

      var conn = pool.getConnection();
      ...

      catch (break) {
          conn.close();
          conn = null;
      }

      catch (continue) {
          conn = pool.getConnection();
      }
}

with the patch would like:

var pool = ...;

function someFunction() {

      var conn = null;
      try {
          if (conn == null) {
              conn = pool.getConnection();
          }
          ...
      } finally {
          conn.close();
          conn = null;
      }
}
</quote>

so now you have to fetch the connection yourself each time the continuation is 
resumed right? Is there any chance for porting that feature into new 
implementation?

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message