7 Replies Latest reply on Mar 13, 2007 10:07 AM by Pete Muir

    Problem with Seam Email - in Loop + Transaction

    Bradley Smith Master


      I'm running into some new issues with the Seam Email Renderer. These issues emerge when 2 or more emails are sent in a single transaction.

      one issue:

      <m:to name="#{nonTestEvergreenUser.name}">#{mailConfiguration.testEmail}</m:to>

      when used this way, it appears that facelets (or something) caches what goes inside the <m:to> tags - what happens is that the email keeps getting calculated as:

      #{mailConfiguration.testEmail} = #{mailConfiguration.testEmail} + cached value

      so if mailConfiguration.testEmail == joe@joe.com, then we have:

      First usage of template in transaction:

      #{mailConfiguration.testEmail} = joe@joe.com (now this gets cached)

      Second usage of template in transaction:

      #{mailConfiguration.testEmail} = joe@joe.comjoe@joe.com (this gets cached)

      and so on with the EL expression growing each time the Renderer uses the same template to send an email.

      There's still another issue that I think comes from using Facelets templates... basically, everytime a same template is used to render in the scope of a transaction, the last rendering gets concatenated to the current rendering (another caching problem I think).