In my web application, I get the Concurrency Problem in JPA ID Generation.
I use Table generation strategy. I already get Concurrency Issue of JPA ID Generation.
How can I avoid Concurrency Problem in JPA ID Generation?
What will be better way for ID generation?
Does Spring 3.0 have a way to avoid it?
Actually, I worry about the database dependency if I use other id generation strategy.
EclipseLink will normally use a separate transaction for allocating generated ids. If you use a JTA DataSource then it cannot, unless you also provide a non-jta-datasource in your persistence.xml.
Also if you trigger a database transaction early (such as a flush) then table id generation will have to use the transactional connection unless you specify a sequence connection pool.
See,
http://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/p_connection_pool_sequence.htm#BABIDAGH