Ok guys
This is a big application for a banking systems and as you know the Oracle's
sequences have some problem. The sequences take up cache and this ends up
with lacking of cache places and finally the whole performance will be
downgraded. There are lots of tables and each has its own sequence so in
return we decided to remove those sequences that been created for the base
tables which are created to keep basic data and we know that the insert
operation on them is low (perhapse 3000 at worst condition) so getting the
max id and increasing it is much better than using sequences and fill up the
database cache.

And for concurrency issues we know that inserting these sort of data will be
taken palce once at the installing system and rarely will be occurs and if
at worst condition a concurrent insertion happens the second user will
encounter an error and have to try again. This is much better than the other
users waits for a long time just for a small withdrawal of cash

Now what do you think on this idea?



Daryl Stultz wrote:
> 
> On Sun, May 17, 2009 at 1:30 PM, Wes Wannemacher <[email protected]> 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:[email protected]
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/id-and-%40GeneratedValue-tp2916124p2945713.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to