On Tuesday 01 February 2011 11:49:51 Paul Belanger wrote: > On 11-01-26 02:59 PM, Tilghman Lesher wrote: > > On Wednesday 26 January 2011 07:01:12 Paul Belanger wrote: > >> [CREATECALL] > >> dsn=Example > >> writesql=INSERT INTO x (y) VALUES (z) > >> readsql=SELECT LAST_INSERT_ID(); > > > > That assumes you have only one call in existence at a time. If two > > calls came in and executed the query at about the same time, it's > > possible for both reads to return the same value. > > Yup, didn't even think of that. My testing of ODBC was a single > channel. Guess I need another method to return the last ID of the > record that was just inserted.
Assuming you were using a MySQL backend that supported transactions, you could use the transaction layer in Asterisk 1.6.2 and greater to ensure that each channel got a serialized view. That would make this approach work. -- Tilghman -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users