[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3011) merge() optimization for Oracle dialect

Yves Galante (JIRA) noreply at atlassian.com
Wed Feb 27 18:25:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29610 ] 

Yves Galante commented on HHH-3011:
-----------------------------------


I think if you use "unsaved-value" parameter on field ID,VERSION or TIMESTAMPS, hibernate will not generate an SELECT when you call session.merge or session.saveorupdate.

____________

Hibernate doc (5.1.4.5)

"Choosing the assigned generator makes Hibernate use unsaved-value="undefined", forcing Hibernate to go to the database to determine if an instance is transient or detached, unless there is a version or timestamp property, or you define Interceptor.isUnsaved()."

> merge() optimization for Oracle dialect
> ---------------------------------------
>
>                 Key: HHH-3011
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3011
>             Project: Hibernate3
>          Issue Type: Improvement
>          Components: core
>            Reporter: MG
>            Priority: Minor
>
> merge() optimization for Oracle dialect.
> Since 9i Oracle has a MERGE statement which is very useful to save round trips to database in merge() call
> which will make dramatic improvement for performance  of loading large row sets.
> MERGE command processes the conditional INSERT-or-UPDATE within a single statement.
> So instead of doing 'select' first to detect whether entity is in database or not (This is one round trip to DB)
> and then issuing 'update' or 'insert' all of it could be done in one statement with no extra round trips using oracle SQL MERGE statement.
> http://www.oracle.com/technology/products/oracle9i/daily/Aug24.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list