> I'm trying to find a good solution that works for me when it > comes to the classic problem of selecting the last inserted > ID in a database table and making sure it's thread safe. > I came across this article that basically says that CF can > handle this all on it's own (no need for cftransaction or > using @@identity etc). > > Does anyone know if there is any truth to this: > http://weblogs.macromedia.com/cantrell/archives/2004/11/safely > _selectin_1.cfm
He's using a MySQL function to return the identity value, which is analogous to using @@IDENTITY/SCOPE_IDENTITY() in SQL Server. Different databases handle things, well, differently, so you can't guarantee that this approach will work across all databases. With SQL Server, for example, @@IDENTITY doesn't work exactly the same as SCOPE_IDENTITY - if I recall correctly, one is connection-specific while the other is not. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262806 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

