Probably, the issue is likely because we have to hit the DB to get the id anyway
And, in general, it is not recommended to use identity for other reasons.usage of batching is one good reason
Will this be on by default?
I’ve seen this comment before but never found a good explanation of why identity is not recommended. Is there a good write up of the problem and what the various solutions are?
identity is good if you want an always increasing number and you want the DB to handle that.
Fabio Maulo schrieb:
> Hi Jon.Do you have some write where somebody explain why identity is so good
> Using ORM identity is not recommended because the only way to know the ID of
> the entity is writing the entity itself in a safe state and hopefully inside
> a transaction and, after the INSERT INTO, read, in some way, the result to
> know the ID.
> There are various other reasons... for example try a migration.
> Take a look here
> Please if you find something where somebody explain why identity is so good
> instead a simple int, let me know.
> 2008/11/7 Jon Palmer <jpa...@contactnetworks.com>
>> I've seen this comment before but never found a good explanation of why
>> identity is not recommended. Is there a good write up of the problem and
>> what the various solutions are?
>> *From:* nhu...@googlegroups.com [mailto:nhu...@googlegroups.com] *On
>> Behalf Of *Fabio Maulo
>> *Sent:* Friday, November 07, 2008 8:28 AM
>> *To:* nhu...@googlegroups.com
>> *Subject:* [nhusers] Re: Second Level Cache on Insert
On Mon, Nov 24, 2008 at 3:14 PM, Gustavo Ringel
> you have also hilo. You can read about it on the documents in this list. I
> think it is a Steve Ambler articles that Fabio posted.
another question, the hilo generator will update and select the
hibernate_unique_key table to get the value for id, is there
concurrency problem in high traffic application?