Oracle Sequences and Triggers

Posts   
 
    
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 04-Jun-2009 16:46:32   

Friends: How does LLBLGen account for the case of an autoincrementing PK using a sequence that is triggered on insert? Currently, specifying which sequence the PK should use, when inserting a records, the DAL gets the next value, uses that to insert, and the code thinks it has the correct PK. Unfortunately the trigger on te DB side is fired and subsequently inserts PK + 1 causing the entity to be out of sync. Is there a way to get the correct PK back in this scenario?


Using v2.6 release October 6th, 2008 with Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Jun-2009 04:18:03   

Hi Seth, please check the Trigger based sequence values topic of the LLBLGenPro manual. There you can find how to do that wink

David Elizondo | LLBLGen Support Team
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 05-Jun-2009 19:47:11   

Thanks!