The two query approach secures the id from the sequence though. No other thread, request, etc can get the same sequence value.
Now, if you were to manually build and control a numeric sequence ala SELECT Max(id) + 1 as newid FROM tblname, then you would have to worry about this issue and use a transaction or lock orsomething. But with Oracle's sequence, no need to worry. DK On 7/12/05, Aaron Rouse <[EMAIL PROTECTED]> wrote: > > Yes, but isn't the point in doing the CFTRANSACTION in the way I am > describing to ensure that you get the ID of what you just inserted in > order > to pass it back to the website? More than likely to pass it back with a > URL > for telling the user hey this is where you go to view status or to edit > what > you just put in our database. I thought the point in doing the > CFTRANSACTION > for this was not so that you can do a rollback on the sequence(which we > all > agree can not happen anyway) but was to ensure when things are being > inserted by multiple people and around the same times that each person > gets > the ID that belongs to them. > > On 7/12/05, Douglas Knudsen > > ok. as I mentioned earlier in the this thread, a rollback does not effect > a > sequence. So wrapping a transaction around these too queries is no > different > really then wrapping it around the single insert. > > DK > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211637 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

