Re: How to generate sequence in MySql
Posted by:
Rod Sherer
Date: March 16, 2009 09:00AM
Does this really solve the issue with concurrency? I have found that MySQL can lose values such as what would be returned by LAST_INSERT_ID when there are multiple transactions going on at the same time.
E.g.:
transaction 1: INSERT TO TABLE
transaction 2: INSERT TO TABLE
transaction 1: Call LAST_INSERT_ID... which I would think would return the value created by transaction 2, not transaction 1. My thought is that once transaction 2 makes it's insertion the value from transaction 1 is lost.
Am I right about this, or is this really thread safe?
Subject
Views
Written By
Posted
167246
March 13, 2007 08:05AM
73288
March 22, 2007 10:34PM
66815
March 26, 2007 08:49AM
53521
March 26, 2007 09:31PM
30741
April 04, 2007 03:00AM
24392
April 05, 2007 02:37AM
21416
November 10, 2008 06:40AM
26374
November 21, 2007 03:50AM
30084
January 29, 2008 08:33PM
17561
February 06, 2008 12:16PM
18358
October 15, 2008 01:03PM
12276
November 05, 2008 09:50AM
14092
November 10, 2008 06:32AM
15503
December 14, 2008 07:08AM
18285
January 23, 2009 05:38PM
Re: How to generate sequence in MySql
8535
March 16, 2009 09:00AM
10277
March 16, 2009 09:18AM
8453
March 16, 2009 09:51AM
9347
March 16, 2009 10:23AM
8289
April 12, 2009 07:58AM
9838
April 03, 2009 03:07PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.