[hibernate-dev] merge on new entities

Emmanuel Bernard emmanuel at hibernate.org
Mon Jan 27 04:38:30 EST 2014


We might, but to add to the complexity, Hibernate ORM uses "merge" plans
to optimize the number of selects for a given object graph merged.
A non associated object being merged might be more common though, not
sure.

On Mon 2014-01-27  9:14, Sanne Grinovero wrote:
> Thanks!
> yes we got to that conclusion. The question came from Radim in
> Infinispan team attempting to figure out how to squeeze some more
> performance from the JPACacheStore from Infinispan.
> 
> It's tricky that in Infinipan we don't know if something is a new
> entry or an update; I had a highly customized MySQL CacheStore which
> used the "INSERT OR UPDATE" statement, a non-standard feature from
> that DB which is very useful for this case.
> 
> Could be interesting for Hibernate ORM to think of a JPA merge
> implementation which could take advantage of such custom extensions?
> Requires quite a different Dialect API.
> 
> Sanne
> 
> On 27 January 2014 09:07, Emmanuel Bernard <emmanuel at hibernate.org> wrote:
> > If the id is assigned, we do a select first. Not super efficient but
> > that's about the only thing you can do.


More information about the hibernate-dev mailing list