Hi Tobias, OpenJPA uses "FOR UPDATE" or an equivalent clause when selecting sequence value. Most often this results in a row lock in database although a particular database may lock a page (a few rows) or even the whole table. As far as I remember, DB2 would lock a row in this case.
The lock contention is rather a function of the number of threads in application(s) rather than number of applications. There is an option to treat the selected sequence value as a source for a range of values. This way one sequence value retrieval can feed, say, 100 entities in an application. Cheers, Milosz > > OpenJPA's implementation (TableJDBCSeq) of the table based sequence > generation stores the sequence state in a table called > OPENJPA_SEQUENCE_TABLE. There can be one counter over all entities or a > separate counter per entity class. > > How are you experiences with many JPA applications (n >> 1) using the table > strategy with a single shared DB2 schema? > > Won't there be locks on the OPENJPA_SEQUENCE_TABLE when multiple > applications select their new sequence values? If using a separate counter > per entity class, will there be at least only locks per row (and not per > table)? > > TIA, > Tobias >
