Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] TableGenerator and concurrency

By default TableGenerator uses the same connection that's used by insert.
To instruct Eclipselink to use a separate connection for table sequencing specify
<property name="eclipselink.jdbc.sequence-connection-pool" value="true"/>
For that to work in JTA case specify nonJtaDatasource (it will be used by sequencing connections).

On 5/31/2013 3:33 PM, Laird Nelson wrote:
Hello; I hope that in particular Andrei is lurking :-)

We have a table set up to support EclipseLink's @TableGenerator support.
  It is called jpa_sequence.

We are seeing that in the presence of many concurrent inserts there is a
ton of contention over this table.  It looks like perhaps the algorithm
that reserves identifiers from the table is not run in its own
transaction, or...well, in any event, it appears that the transactions
that wrap our inserts are blocking EclipseLink from periodically
UPDATEing the jpa_sequence table.

I'm having trouble explaining this.  Let me try again.

We have lots of concurrent processes running that need to do a ton of
entity insertions.  All these entities are of the same type.  All use
table generation for their identifier allocation.

Each such insertion runs in its own transaction.  The transaction is
non-trivial and can take a while.

We notice that the periodic UPDATE jpa_sequence WHERE... statements that
EclipseLink issues are timing out against our Informix database
periodically, because (it seems) they are being issued in the context of
the *business* transaction (the non-trivial one wrapping an insert) and
not in their own transaction (as I thought would be the case).

Could someone kindly describe exactly--including transactional and
locking semantics--the steps taken by the EclipseLink @TableGenerator
support to allocate a new identifier?

Best,
Laird

--
http://about.me/lairdnelson


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top