I need to get the id from a previous insert to use as a foreign ke in another table
I am using the connection pool below in a web application.
Can i use LAST_INSERT_ID() in this configuration whithout the risk of getting the wrong value?
At the very least, you will want to send the LAST_INSERT_ID query to the same connection which did the INSERT statement. None of the code you posted seems to show an example of what you are doing.