title: How to use database triggers in a real world project?
body: <p>I've learned a lot about triggers and active databases in the last weaks, but I've some questions about real world examples for these.</p>
  
  <p>At work we use the Entity Framework with ASP.Net and an MSSQL Server. We just use the auto generated constrains and no triggers.</p>
  
  <p>When I heared about triggers I asked myself the following questions:</p>
  
  <ol>
  <li><p>Which tasks can be performed by triggers?
  e.g.: Generation of reporting data: currently the data for the reports is created in vb, but I think a trigger could handle this as well. The creation in vb takes a lot of time and the user should not need to wait for it, because it's not necessary for his work.
  Is this an example for a perfect task for a trigger?</p></li>
  <li><p>How does OR-Mapper handle trigger manipulated data?
  e.g.: Do OR-Mapper recognize if a trigger manipulated data? The entity framework seems to cache a lot of data, so I'm not sure if it reads the updated data if a trigger manipulates the data, after the insert/update/delete from the framework is processed.</p></li>
  <li><p>How much constraint handling should be within the database?
  e.g.: Sometimes constrains in the database seem much easier and faster than in the layer above (vb.net,...), but how to throw exceptions to the upper layer that could be handled by the OR-Mapper?
  Is there a good solution for handeling SQL exceptions (from triggers) in any OR-Mapper?</p></li>
  </ol>
  
  <p>Thanks in advance</p>