openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <da...@6degrees.com>
Subject Re: id and @GeneratedValue
Date Tue, 19 May 2009 12:04:56 GMT
On Sun, May 17, 2009 at 1:30 PM, Wes Wannemacher <wesw@wantii.com> wrote:

> That is generally a bad idea. Select max(row) will generally initiate
> a full index scan or, even worse, a full table scan.
>

Isn't it a greater problem that this approach is a race condition? 2 threads
call max(id) about the same time and then try to insert max + 1 one just
after the other.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message