You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Kevin Sutter <kw...@gmail.com> on 2012/06/05 21:18:11 UTC

Re: Questions about TableGenerator

Hi,
The default id generator is Table since it's universal.  Every database
vendor can support the use of a separate table for keeping track of
generated ids.  In your case, Oracle also supports the use of Sequence and
Identity -- although the use of Identity does require the use of triggers
[1].

Regardless of which strategy you use, I would not use an allocation size of
1.  That would force too many trips to the database.  I believe the default
is 50.  This setting will depend on your application, but 1 just seems too
small for most applications.

With Table id generation, we do lock the row when we can.  Some databases
only allow locking of the whole table, but we use the most granular locking
that we can.

Hope this helps,
Kevin

[1]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_pc_oid_pkgen_autoinc

On Wed, May 30, 2012 at 10:56 AM, Anu Padki <AP...@cover-all.com> wrote:

> Hello all,
>
>
>
> I wanted to find out about the openjpa table generator, is it a good
> idea to use it?
>
> This is how I am planning to use it
>
> The db is Oracle, and I am creating a row in the tablegenrator table for
> each primary key, with allocation size equal to 1.
>
>
>
> My concerns are about the performance, how does openjpa lock the row,
> does it lock the row or does it lock the table?
>
>
>
> Regards
>
> -          Ana
>
>
>
>

Re: Questions about TableGenerator

Posted by manushka <pa...@gmail.com>.
Thanks Kevin, I am using oracle and I see the select .. for update being
used.
- Anu

--
View this message in context: http://openjpa.208410.n2.nabble.com/Questions-about-TableGenerator-tp7580199p7580222.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.