Hello Mike, your understanding is correct.
Trigger'ed INSERT was the only scenario I could think of on top of my head. But in general if there is any other scenario where more than one Identity columns are inserted before you call "values identity_val_local()" u'll face the issue. However this behaviour is local to a connection, so identity column INSERTS done on different connections do not come on the way of each other. Which is the basic isolation property of database connection. -akhil "Michael Becke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Akhil, > > Thank you for chiming in on this issue. This is something I was not > aware of. So, just to make sure I understand what you are saying, the > SeqMgr: > > - should not use the table name when getting the identity value to > avoid being misleading > - should not be used on tables that trigger other table inserts > > Is this correct? > > Mike > > On Monday, August 25, 2003, at 07:26 AM, Akhil Kumar wrote: > > > > > > Hi, > > This is a response to #OJB201... > > (http://scarab.werken.com/issues/id/OJB201) > > I had spent some time earlier on the approach suggested in this issue > > but > > did not post it for the reason documented below > > I thaught it'll be better that others also understand the implications > > (of > > Identity Column based SeqMgr ) > > > > Platform.getLastInsertIdentity() should not be implemented as > > described in > > the defect ! > > > > The db/2 scalar function 'identity_val_local() ' does not take any > > parameter... > > it is supposed to return the value of last identity column that was > > incremented ! > > The reporter of the defect has recommended using > > "select identity_val_local() from <tableName> fetch first ro only" > > however the above SQL has nothing to do with the <tableName>.. > > > > running it is as good as running: "values identity_val_local()" which > > does > > not take any table name. > > and it can make the usage of "values identity_val_local()" : > > potentially > > dangerous: > > in the following scenario: > > > > -Table T1 uses Identity column (and used in O-R mapping) > > -A Trigger is defined for INSERTS in T1 which inserts a record in T2 > > (T2 > > has nothing to do with OR business) > > (such approaches are there in many systems e.g. automatically > > calculating summaries etc) > > -both T1 and T2 use Identity columns. > > -OJB inserts a record in T1 which leads to another record getting > > added to > > T2 > > -"values identity_val_local()" will return the value of identity > > column in > > T2 and not T1, as required by the native based SeqMgr. > > > > thanks > > akhil > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
