title: Best practice for implementing in Ada (2005 or 2012) an equivalent of the java finalize block
body: <p>Java has the finalize block which allows to execute some statements after a block
  is left (executed even if an exception is raised). Example:</p>
  
  <pre><code>try {
    ...
  } catch (Exception e) {
    ...
  } finally {
    ... // any code here
  }
  </code></pre>
  
  <p>Ada has the controlled objects which allows to implement a <strong>Finalize</strong> operation
  but there is no finalize block equivalent as in java. This is useful for logging,
  closing files, transactions and so on (without having to create a specific tagged type for each possible block).</p>
  
  <ol>
  <li>How would you implement such finalize block in Ada 2005 (while keeping the code readable)?</li>
  <li>Are there plans in Ada 2012 to allow executing any finalization code easily? </li>
  </ol>