Database Triggers - Forum - OpenEdge Development - Progress Community
 Forum

Database Triggers

This question is answered

Hi.

What is the "recommended" usage of database triggers in OE applications these days?

Are they still okay to use, or is it considered ancient, legacy, bad-idea, etc.? 

Jeff Ledbetter

Roundtable Product Architect

www.roundtable-software.com

Verified Answer
  • Thank you all for input. It all matches our internal dialog on some level.

    "..that may imply that you have multiple creates of a table in various portions of the application"

    Not all applications are perfect. :)

    Jeff Ledbetter

    Roundtable Product Architect

    www.roundtable-software.com

All Replies
  • Only there is also a disable triggers statement and ‘everywhere' does not include the SQL engine (JDBC/ODBC) so I would say it’s probably time for Progress to actually become a relational database and add a long due support for foreign keys inside the database server instead of pretending this can be done using triggers (running on client space).

    Marian Edu

    Acorn IT 
    +40 740 036 212

  • Yes.
    Von: Peter Judge [mailto:bounce-pjudge@community.progress.com]
    Gesendet: Montag, 20. März 2017 19:43
    An: TU.OE.Development@community.progress.com
    Betreff: RE: [Technical Users - OE Development] Database Triggers
     
    Update from Progress Community
     
    Ah, so you’re saying do both and then you don’t get hurt in the case where a single-table-create doesn’t previously assign values?
     

    View online

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

     

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • I have always felt that the core flaw of db triggers was that it put the logic of record creation, modification, and deletion in two different places -- partly in the trigger and partly in the application code.  There is nothing in either to tell you what is happening in the other one.  A properly designed modern application is going to have these actions centralized in a component responsible for those actions so there is one place to check to see what is happening and one place to modify if changes are needed.  DB triggers get in the way of that goal.

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • Oh dear. I agree with the Doctor. Have I been assimilated ?

  • We all have been partly assimilated 😊 See my earlier comment

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Thank you all for input. It all matches our internal dialog on some level.

    "..that may imply that you have multiple creates of a table in various portions of the application"

    Not all applications are perfect. :)

    Jeff Ledbetter

    Roundtable Product Architect

    www.roundtable-software.com

  • Not all applications are perfect, but this should not be used as an excuse to just do what is expedient or convenient.  We should understand what is better and constantly strive to incorporate that into the application whenever possible.

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • Agreed. It was a theoretical question that came up while updating code (within the app) to set the field value.

    Jeff Ledbetter

    Roundtable Product Architect

    www.roundtable-software.com

  • Thomas Mercer-Hursh

    Not all applications are perfect, but this should not be used as an excuse to just do what is expedient or convenient.  We should understand what is better and constantly strive to incorporate that into the application whenever possible.

    You are absolutely right and this is exactly what I told management here. It was a few seconds before they started laughing and walked away.

    Did I say something weird?

  • Patrick Tingen

    Thomas Mercer-Hursh

    Not all applications are perfect, but this should not be used as an excuse to just do what is expedient or convenient.  We should understand what is better and constantly strive to incorporate that into the application whenever possible.

    You are absolutely right and this is exactly what I told management here. It was a few seconds before they started laughing and walked away.

    Did I say something weird?

    Just sounds like they made a different 2 out of 3 picks from "fast, good, cheap" than you would...