[OpenSIPS-Users] MySQL LAST_INSERT_ID() safe?

Chris Maciejewski chris at wima.co.uk
Wed Dec 1 12:38:16 CET 2010


Hi Bogdan,

Thanks very much for clarification.

Best regards,
Chris

On 30 November 2010 20:21, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
> Hi Chris,
>
> It is safe, as opensips has a mysql connection for each process and a script
> route is continuously executed by a single process.  So your queries will go
> via same connection with no risk to have something else between.
>
> Regards,
> Bogdan
>
> Chris Maciejewski wrote:
>>
>> Hi,
>>
>> I am trying to figure out if is it safe to use in OpenSIPs config file:
>>
>> avp_db_query("INSERT INTO some_table VALUES ('data1')");
>> avp_db_query("SELECT LAST_INSERT_ID()","$avp(last_id);");
>>
>> // do stuff with $avp(last_id);
>>
>> How does OpenSIPs connects to MySQL sever? Does it use some smart
>> connection pooling maybe, which could result in unexpected behaviour?
>>
>> Regards,
>> Chris
>>



More information about the Users mailing list