Trigger on Transaction and Lock !!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SLauren
    New Member
    • Feb 2009
    • 60

    Trigger on Transaction and Lock !!!!

    Hi All,

    I have a post insert trigger for Table ‘A’ that will insert data into Table ‘B’. My question is once the data being inserted into Table ‘A’ through a transaction from Business layer, Whether the after trigger will get executed once the transaction gets committed or the trigger will get executed once the data get inserted into table ‘A’ (Before the transaction gets committed)? If it is the later case then, what happens if the transaction failed [Rollback]?


    If subsequent DML operations are being executed on Table ‘A’ through a transaction from Business layer, E.g. , Update some rows and Insert some new data, are there any chances of dead lock that could happen on Table ‘A’?

    Thanks,
    Lauren
  • wizardry
    New Member
    • Jan 2009
    • 201

    #2
    we need more info.

    what type of trigger? before / after ?
    if before then the data is captured before its commited.
    if after then its after before trigger runs and is commited.

    about locks. locks are turned on a per table basis and should be used only with indepth knowledge of use of locks. it can slow down your site. locks are already taken on the database server level for each new client session on the given call or procedure from the form elements.







    hope this helps

    Comment

    Working...