SlideShare a Scribd company logo
1 of 54
Performance Tuning

@Sander_Mak


branchandbound.net
Hibernate sucks!
      ... because itā€™s slow
Hibernate sucks!
      ... because itā€™s slow
     ā€˜The problem is sort of cultural [..] developers
     use Hibernate because they are uncomfortable
     with SQL and with RDBMSes. You should be
     very comfortable with SQL and JDBC before you
     start using Hibernate - Hibernate builds on
     JDBC, it doesnā€™t replace it. That is the cost of
     extra abstraction [..] save yourself effort,
     pay attention to the database at all stages
     of development.ā€™
                               - Gavin King (creator)
ā€˜Most of the performance problems we have come
up against have been solved not by code
optimizations, but by adding new functionality.ā€™

                       - Gavin King (creator)
ā€˜You can't communicate complexity,
only an awareness of it.ā€™

     - Alan J. Perlis (1st Turing Award winner)
Outline
 Optimization
 Lazy loading
 Examples ā€˜from the trenchesā€™
   Search queries
   Large collections
   Batching
 Odds & Ends
Optimization
Optimization is hard
 Performance blame
   Framework vs. You
 When to optimize?

 Preserve correctness at all times
   Unit tests ok, but not enough
   Automated integration tests
Optimization is hard
 Performance blame
   Framework vs. You
 When to optimize?

 Preserve correctness at all times
   Unit tests ok, but not enough
   Automated integration tests

  Premature optimization is the root of all evil
                                     - Donald Knuth
Optimization guidelines
Measurement
 Ensure stable, production-like environment
 Measure time and space
   Time: isolate timings in different layers
   Space: more heap -> longer GC -> slower
 Try to measure in RDBMS as well
   IO statistics (hot cache or disk thrashing?)
   Query plans
 Make many measurements -> automation
Optimization guidelines
Practical
 Proļ¬ler on DAO/Session.query() methods
 VisualVM etc. for heap usage
     many commercial tools also have
     built-in JDBC proļ¬ling
 Hibernate JMX
  <property name="hibernate.generate_statistics">true
  </property>




 RDBMS monitoring tools
Analyzing Hibernate
Log SQL:   <property name="show_sql">true</property>
           <property name="format_sql">true</property>


Log4J conļ¬guration:
  org.hibernate.SQL -> DEBUG
  org.hibernate.type -> TRACE (see bound params)

Or use P6Spy/Log4JDBC on JDBC connection
Analyzing Hibernate
    2011-07-28 09:57:12,061 DEBUG org.hibernate.SQL - insert into BASKET_LINE_ALLOC (LAST_UPDATED,      QUANTITY,
    CUSTOMER_REF, NOTES, BRANCH_ID, FUND_ID, TEMPLATE_ID,
    BASKET_LINE_ALLOC_ID) values (?, ?, ?, ?, ?, ?, ?, ?)


Log SQL:
    2011-07-28 09:57:12,081 DEBUG org.hibernate.type.TimestampType - binding '2006-07-28 09:57:12' to   parameter: 1
    2011-07-28 09:57:12,081 DEBUG org.hibernate.type.IntegerType - binding '3' to parameter: 2
                        <property name="show_sql">true</property>
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 3
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 4

                        <property name="format_sql">true</property>
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '511' to parameter: 5
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '512' to parameter: 6
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding null to parameter: 7
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '180030' to parameter: 8
    Hibernate: INSERT INTO mkyong.stock_transaction (CHANGE, CLOSE, DATE, OPEN, STOCK_ID, VOLUME)

Log4J conļ¬guration:
    VALUES (?, ?, ?, ?, ?, ?)
    2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '10.0' to parameter: 1
    2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '1.1' to parameter: 2
    2011-07-28 13:33:07,253 DEBUG DateType:133 - binding '30 December 2009' to parameter: 3


  org.hibernate.SQL -> DEBUG
    2011-07-28 13:33:07,269 DEBUG FloatType:133 - binding '1.2' to parameter: 4
    2011-07-28 13:33:07,269 DEBUG IntegerType:133 - binding '11' to parameter: 5
    2011-07-28 13:33:07,269 DEBUG LongType:133 - binding '1000000' to parameter: 6
    2011-07-28 09:57:12,061 DEBUG org.hibernate.SQL - insert into BASKET_LINE_ALLOC (LAST_UPDATED,      QUANTITY,
    CUSTOMER_REF, NOTES, BRANCH_ID, FUND_ID, TEMPLATE_ID,

  org.hibernate.type -> TRACE (see bound params)
    BASKET_LINE_ALLOC_ID) values (?, ?, ?, ?, ?, ?, ?, ?)
    2011-07-28 09:57:12,081 DEBUG org.hibernate.type.TimestampType - binding '2006-07-28 09:57:12' to
    2011-07-28 09:57:12,081 DEBUG org.hibernate.type.IntegerType - binding '3' to parameter: 2
                                                                                                        parameter: 1

    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 3
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 4
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '511' to parameter: 5
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '512' to parameter: 6
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding null to parameter: 7


Or use P6Spy/Log4JDBC on JDBC connection
    2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '180030' to parameter: 8
    Hibernate: INSERT INTO mkyong.stock_transaction (CHANGE, CLOSE, DATE, OPEN, STOCK_ID, VOLUME)
    VALUES (?, ?, ?, ?, ?, ?)
    2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '10.0' to parameter: 1
    2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '1.1' to parameter: 2
    2011-07-28 13:33:07,253 DEBUG DateType:133 - binding '30 December 2009' to parameter: 3
    2011-07-28 13:33:07,269 DEBUG FloatType:133 - binding '1.2' to parameter: 4
    2011-07-28 13:33:07,269 DEBUG IntegerType:133 - binding '11' to parameter: 5
    2011-07-28 13:33:07,269 DEBUG LongType:133 - binding '1000000' to parameter: 6
Lazy loading
Lazy loading
One entity to rule them all                   Request

Mostly sane defaults:                                  1..1




@OneToOne,
@OneToMany,                                      User
@ManyToMany: LAZY                             1..*          *..1


@ManyToOne : EAGER
(Due to JPA spec.)            Authorization


Extra-lazy: Hibernate                            *..1



speciļ¬c                         Global
                               Company
                                                     1..*          Company
LazyInitializationException
Lazy loading          N+1 Selects problem

Select list of N users      HQL: SELECT u FROM User

Authorizations necessary:   SQL 1 query:
                            SELECT * FROM User
  N select queries on         LEFT JOIN Company c
  Authorization executed!     WHERE u.worksForCompany =
                              c.id
Solution:
  FETCH JOINS
  @Fetch(FetchMode.JOI
  N)
  @FetchProļ¬le (enable
  per session
  donā€™t call .size()
Lazy loading          N+1 Selects problem

Select list of N users      HQL: SELECT u FROM User

Authorizations necessary:   SQL N queries:
                            SELECT * FROM Authorization
  N select queries on         WHERE userId = N
  Authorization executed!
Solution:
  FETCH JOINS
  @Fetch(FetchMode.JOI
  N)
  @FetchProļ¬le (enable
  per session
  donā€™t call .size()
Lazy loading          N+1 Selects problem
                            HQL: SELECT u FROM User OUTER
Select list of N users      JOIN FETCH u.authorizations
Authorizations necessary:
                            SQL 1 query:
  N select queries on       SELECT * FROM User
  Authorization executed!     LEFT JOIN Company c LEFT
                              OUTER JOIN Authorization
Solution:                     ON .. WHERE
                              u.worksForCompany = c.id
  FETCH JOINS
  @Fetch(FetchMode.JOI
  N)
  @FetchProļ¬le (enable
  per session
  donā€™t call .size()
Lazy loading
Some guidelines
 Laziness by default = mostly good
 However, architectural impact:
   Session lifetime (ā€˜OpenSessionInViewā€™ pattern)
   Extended Persistence Context
   Proxy usage (runtime code generation)
 Eagerness can be forced with HQL/JPAQL/Criteria
 But eagerness cannot be reverted
   exception: Session.load()/EntityManager.getReference()
Search queries
Search queries



                                     Search

                   User



                                                Result list
                1..*          *..1




Authorization

                   *..1


  Global               1..*           Company
 Company

                                                              Detail
Search queries
Obvious solution:

Too much information!
Use summary objects:



UserSummary = POJO
  not attached, only necessary ļ¬elds (no relations)
Search queries
Obvious solution:

Too much information!
Use summary objects:



UserSummary = POJO
  not attached, only necessary ļ¬elds (no relations)
  Or: drop down to JDBC to fetch id + ļ¬elds
Search queries
Alternative:

Taking it further:




Pagination in queries, not in app. code
Extra count query may be necessary (totals)
         Ordering necessary for paging!
Search queries
          Subtle:
Alternative: effect of applying setMaxResults
          ā€œThe
           or setFirstResult to a query involving
         fetch joins over collections is undeļ¬nedā€
Taking it further:
         Cause: the emitted join possibly returns
             several rows per entity. So LIMIT,
            rownums, TOP cannot be used!
          Instead Hibernate must fetch all rows
         WARNING: firstResult/maxResults specified with
Pagination in queries, not in app. code
                  collection fetch; applying in memory!


Extra count query may be necessary (totals)
         Ordering necessary for paging!
Analytics & reporting
  ORM less relevant: no entities, but complex
  aggregations
  Simple sum/avg/counts possible over entities

  Specialized db calls for complex reports:
     Partitioning/windowing etc.
  Integrate using native query
  Or create a database view and map entity
Large collections
Large collections
      Frontend:
       Request
     CompanyGroup
          1..*


                             Backend:
        Company
                            CompanyGroup
                                  1..*
                                             Meta-data


Company read-only entity,   CompanyInGroup
backed by expensive view          *..1




                               Company
Large collections
  Frontend:
   Request
 CompanyGroup
      1..*


                    Backend:
   Company
                    CompanyGroup
                         1..*
                                   Meta-data

                CompanyInGroup
                         *..1




                      Company
Large collections
  Frontend:
   Request
 CompanyGroup
      1..*


                    Backend:
   Company
                    CompanyGroup
                         1..*
                                   Meta-data

                CompanyInGroup
                         *..1




                      Company
Large collections
 Opening large groups sluggish
 Improved performance:

 Fetches many uninitialized collections in 1 query
 Also possible on entity:

                                                 Request
                                               CompanyGroup
                                                     1..*




                                                 Company
Large collections
 Opening large groups sluggish
 Improved performance:

 Fetches many uninitialized collections in 1 query
 Also possible on entity:

                                                    Request
                                                  CompanyGroup
                                                       1..*




                                                    Company
       Better solution in hindsight: fetch join
Large collections
 Extra lazy collection fetching



 Efļ¬cient:
   companies.size() -> count query
   companies.contains() -> select 1 where ...
   companies.get(n) -> select * where index = n
Large collections
 Saving large group slow: >15 sec.
 Problem: Hibernate inserts row by row
   Query creation overhead, network latency
 Solution: <property name="hibernate.jdbc.batch_size">100
              </property>


 Enables JDBC batched statements
 Caution: global property                                 Request
                                                        CompanyGroup

 Also: <property name="hibernate.order_inserts">true
                                                              1..*




        </property>                                         Company
        <property name="hibernate.order_updates">true
        </property>
Large collections
  Frontend:
   Request
 CompanyGroup
      1..*


                    Backend:
   Company
                    CompanyGroup
                         1..*
                                   Meta-data

                CompanyInGroup
                         *..1




                      Company
Large collections


                    Backend:

                    CompanyGroup
                         1..*
                                   Meta-data

                CompanyInGroup
                         *..1




                      Company
Large collections
Process   CreateGroup (Soap)   Business
Service                         Service

 CreateGroup: ~10 min. for thousands of companies
 @BatchSize on Company improved demarshalling
 JDBC batch_size property marginal improvement
 INFO: INSERT INTO CompanyInGroup VALUES (?,...,?)
 INFO: SELECT @identity
 INFO: INSERT INTO CompanyInGroup VALUES (?,...,?)
 INFO: SELECT @identity
 .. 1000 times                                       CompanyGroup
                                                           1..*
                                                                      Meta-data


 Insert/select interleaved: due to gen. id           CompanyInGroup
                                                           *..1




                                                        Company
Large collections
Process    CreateGroup (Soap)   Business
Service                          Service

 Solution: generate id in app. (not always feasible)
 Running in ~3 minutes with batched inserts
 Next problem: heap usage spiking
 Use StatelessSession
  āœ¦ Bypass ļ¬rst-level cache
  āœ¦ No automatic dirty checking                     CompanyGroup

  āœ¦ Bypass Hibernate event model and interceptors         1..*
                                                                     Meta-data

  āœ¦ No cascading of operations                      CompanyInGroup
  āœ¦ Collections on entities are ignored                   *..1




                                                       Company
Large collections
Process   CreateGroup (Soap)   Business
Service                         Service

 Solution: generate id in app. (not always feasible)
 Running in ~3 minutes with batched inserts
 Next problem: heap usage spiking
 Use StatelessSession

                                              CompanyGroup
                                                    1..*
                                                               Meta-data

                                              CompanyInGroup
                                                    *..1




                                                 Company
Large collections
Process   CreateGroup (Soap)   Business
Service                         Service

 Now <1 min., everybody happy!




                                          CompanyGroup
                                                1..*
                                                           Meta-data

                                          CompanyInGroup
                                                *..1




                                             Company
Large collections
Process   CreateGroup (Soap)   Business
Service                         Service

 Now <1 min., everybody happy!


      Data loss detected!

                                          CompanyGroup
                                                1..*
                                                           Meta-data

                                          CompanyInGroup
                                                *..1




                                             Company
Large collections
Process   CreateGroup (Soap)   Business
Service                         Service   Data loss detected!

 StatelessSession and JDBC batch_size bug




 HHH-4042: Closed, wonā€™t ļ¬x :
                                                    CompanyGroup
                                                         1..*
                                                                    Meta-data

                                                   CompanyInGroup
                                                         *..1




                                                      Company
Odds & Ends
Dirty little secret
                                            validated(item) performs
                                            read-only queries


                          select   currentItem from Catalog where ..
 Dirty collection after   select   spendingLimit from User where ..
 each iteration           insert   into Item values (?, ?, ?)
                          select   currentItem from Catalog where ..
                          select   spendingLimit from User where ..
 Batching fails           insert   into Item values (?, ?, ?)

 Flushmode.AUTO

 Loops always suspect: relational, set-based thinking
Dirty little secret
                                  validated(item) performs
                                  read-only queries



 Dirty collection after
 each iteration
 Batching fails
 Flushmode.AUTO

 Loops always suspect: relational, set-based thinking
Query hints
Speed up read-only service calls:



Hibernate Query.setHint():




Also: never use 2nd level cache just ā€˜because we canā€™
Query hints
Speed up read-only service calls:



Hibernate Query.setHint():




Also: never use 2nd level cache just ā€˜because we canā€™
     @org.hibernate.annotations.Immutable
Large updates
Naive approach:



Entities are not always necessary:



Changes are not reļ¬‚ected in persistence context
With optimistic concurrency: VERSIONED keyword
Large updates
Naive approach:



Entities are not always necessary:



Changes are not reļ¬‚ected in persistence context
With optimistic concurrency: VERSIONED keyword
       Consider use of stored procedures
Cherish your database
Data and schema outlive your application
Good indexes make a world of difference
Stored procedures etc. are not inherently evil
Do not let Hibernate dictate your schema
  Befriend a DBA instead!

There are other solutions (there I said it)
  MyBatis
  Squeryl (Scala)
Thanks for listening!


@Sander_Mak
                         Join me later today:
                     Elevate your webapps
                        with Scala & Lift!

                         17:00 Room C
branchandbound.net

More Related Content

What's hot

Java IO, Serialization
Java IO, Serialization Java IO, Serialization
Java IO, Serialization Hitesh-Java
Ā 
Testing database content with DBUnit. My experience.
Testing database content with DBUnit. My experience.Testing database content with DBUnit. My experience.
Testing database content with DBUnit. My experience.Serhii Kartashov
Ā 
Oracle High Availabiltity for application developers
Oracle High Availabiltity for application developersOracle High Availabiltity for application developers
Oracle High Availabiltity for application developersAlexander Tokarev
Ā 
P9 speed of-light faceted search via oracle in-memory option by alexander tok...
P9 speed of-light faceted search via oracle in-memory option by alexander tok...P9 speed of-light faceted search via oracle in-memory option by alexander tok...
P9 speed of-light faceted search via oracle in-memory option by alexander tok...Alexander Tokarev
Ā 
JDBC Part - 2
JDBC Part - 2JDBC Part - 2
JDBC Part - 2Hitesh-Java
Ā 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
Ā 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Examplekamal kotecha
Ā 
Hibernate - Part 1
Hibernate - Part 1Hibernate - Part 1
Hibernate - Part 1Hitesh-Java
Ā 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Supportnkarag
Ā 
Oracle result cache highload 2017
Oracle result cache highload 2017Oracle result cache highload 2017
Oracle result cache highload 2017Alexander Tokarev
Ā 
Dao example
Dao exampleDao example
Dao examplemyrajendra
Ā 
Dao pattern
Dao patternDao pattern
Dao patternciriako
Ā 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3Rajiv Gupta
Ā 
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...Jim Czuprynski
Ā 
Oracle Text in APEX
Oracle Text in APEXOracle Text in APEX
Oracle Text in APEXScott Wesley
Ā 
Connecting Hadoop and Oracle
Connecting Hadoop and OracleConnecting Hadoop and Oracle
Connecting Hadoop and OracleTanel Poder
Ā 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageSteven Feuerstein
Ā 

What's hot (20)

Java IO, Serialization
Java IO, Serialization Java IO, Serialization
Java IO, Serialization
Ā 
Testing database content with DBUnit. My experience.
Testing database content with DBUnit. My experience.Testing database content with DBUnit. My experience.
Testing database content with DBUnit. My experience.
Ā 
Oracle High Availabiltity for application developers
Oracle High Availabiltity for application developersOracle High Availabiltity for application developers
Oracle High Availabiltity for application developers
Ā 
Persistence hibernate
Persistence hibernatePersistence hibernate
Persistence hibernate
Ā 
P9 speed of-light faceted search via oracle in-memory option by alexander tok...
P9 speed of-light faceted search via oracle in-memory option by alexander tok...P9 speed of-light faceted search via oracle in-memory option by alexander tok...
P9 speed of-light faceted search via oracle in-memory option by alexander tok...
Ā 
JDBC Part - 2
JDBC Part - 2JDBC Part - 2
JDBC Part - 2
Ā 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
Ā 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
Ā 
Hibernate - Part 1
Hibernate - Part 1Hibernate - Part 1
Hibernate - Part 1
Ā 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Ā 
Oracle result cache highload 2017
Oracle result cache highload 2017Oracle result cache highload 2017
Oracle result cache highload 2017
Ā 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
Ā 
Dao example
Dao exampleDao example
Dao example
Ā 
Dao pattern
Dao patternDao pattern
Dao pattern
Ā 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
Ā 
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...
Ā 
Oracle Text in APEX
Oracle Text in APEXOracle Text in APEX
Oracle Text in APEX
Ā 
Connecting Hadoop and Oracle
Connecting Hadoop and OracleConnecting Hadoop and Oracle
Connecting Hadoop and Oracle
Ā 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL Language
Ā 
Hibernate
HibernateHibernate
Hibernate
Ā 

Viewers also liked

Java 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forwardJava 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forwardMario Fusco
Ā 
No more loops with lambdaj
No more loops with lambdajNo more loops with lambdaj
No more loops with lambdajMario Fusco
Ā 
Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Sander Mak (@Sander_Mak)
Ā 
Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)
Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)
Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)Thorben Janssen
Ā 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuningIgor Dmitriev
Ā 
Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot
Delphi ORM SOA MVC SQL NoSQL JSON REST mORMotDelphi ORM SOA MVC SQL NoSQL JSON REST mORMot
Delphi ORM SOA MVC SQL NoSQL JSON REST mORMotArnaud Bouchez
Ā 
ģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµ
ģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµ
ģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµKH Park (ė°•ź²½ķ›ˆ)
Ā 
Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„
Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„
Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„KH Park (ė°•ź²½ķ›ˆ)
Ā 
2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬
2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬
2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬Channy Yun
Ā 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure CallAbdelrahman Al-Ogail
Ā 
RPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œ
RPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œRPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œ
RPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œWonchang Song
Ā 
Mysql Fulltext Search
Mysql Fulltext SearchMysql Fulltext Search
Mysql Fulltext Searchjohnymas
Ā 
Monetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliatesMonetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliatesDigi Joe
Ā 
Lean startup Methodology
Lean startup MethodologyLean startup Methodology
Lean startup Methodologyali raza
Ā 
Ideas - Magzine Advert
Ideas - Magzine AdvertIdeas - Magzine Advert
Ideas - Magzine AdvertDavid Wooldridge
Ā 

Viewers also liked (20)

Java 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forwardJava 7, 8 & 9 - Moving the language forward
Java 7, 8 & 9 - Moving the language forward
Ā 
No more loops with lambdaj
No more loops with lambdajNo more loops with lambdaj
No more loops with lambdaj
Ā 
Modularity in the Cloud
Modularity in the CloudModularity in the Cloud
Modularity in the Cloud
Ā 
Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?Cross-Build Injection attacks: how safe is your Java build?
Cross-Build Injection attacks: how safe is your Java build?
Ā 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
Ā 
Scala & Lift (JEEConf 2012)
Scala & Lift (JEEConf 2012)Scala & Lift (JEEConf 2012)
Scala & Lift (JEEConf 2012)
Ā 
Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)
Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)
Performance Tuning with JPA 2.1 and Hibernate (Geecon Prague 2015)
Ā 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuning
Ā 
Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot
Delphi ORM SOA MVC SQL NoSQL JSON REST mORMotDelphi ORM SOA MVC SQL NoSQL JSON REST mORMot
Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot
Ā 
Vert.x
Vert.xVert.x
Vert.x
Ā 
ģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµ
ģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµ
ģŠ¤ė§ˆķŠøģ•± źø€ė”œė²Œ ģ§„ģ¶œģ „ėžµ
Ā 
Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„
Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„
Hoonsė‹·ė„· ģ¢Œģ¶©ģš°ėŒ 10ė…„, ź·øė¦¬ź³  ģƒˆė”œģš“ ķŒØėŸ¬ė‹¤ģž„
Ā 
2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬
2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬
2013 ė¹…ė°ģ“ķ„° ė° API źø°ģˆ  ķ˜„ķ™©ź³¼ ģ „ė§- ģœ¤ģ„ģ°¬
Ā 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
Ā 
RPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œ
RPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œRPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œ
RPCģ—ģ„œ RESTź¹Œģ§€ ź°„ė‹Øķ•œ ź°œė…ģ†Œź°œ
Ā 
Mysql Fulltext Search
Mysql Fulltext SearchMysql Fulltext Search
Mysql Fulltext Search
Ā 
Monetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliatesMonetising your startup from the word go with advertising & affiliates
Monetising your startup from the word go with advertising & affiliates
Ā 
Lean startup Methodology
Lean startup MethodologyLean startup Methodology
Lean startup Methodology
Ā 
Ideas - Magzine Advert
Ideas - Magzine AdvertIdeas - Magzine Advert
Ideas - Magzine Advert
Ā 
Gastcollege CHE
Gastcollege CHEGastcollege CHE
Gastcollege CHE
Ā 

Similar to Hibernate Performance Tuning

Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data accessgordonyorke
Ā 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerCisco Canada
Ā 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
Ā 
Testing the frontend
Testing the frontendTesting the frontend
Testing the frontendHeiko Hardt
Ā 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol BuffersMatt O'Keefe
Ā 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Stamatis Zampetakis
Ā 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02Gopi Raghavendra
Ā 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)QA Programmer
Ā 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupDavid Barreto
Ā 
Practical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationPractical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationIvo Andreev
Ā 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsJeff Durta
Ā 
Productionalizing ML : Real Experience
Productionalizing ML : Real ExperienceProductionalizing ML : Real Experience
Productionalizing ML : Real ExperienceIhor Bobak
Ā 
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014FalafelSoftware
Ā 
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingBreaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingSteven Smith
Ā 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performanceEngine Yard
Ā 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Pythongturnquist
Ā 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meterPurna Chandar
Ā 
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2Vladimir Bacvanski, PhD
Ā 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJSDicoding
Ā 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
Ā 

Similar to Hibernate Performance Tuning (20)

Accelerated data access
Accelerated data accessAccelerated data access
Accelerated data access
Ā 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data center
Ā 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
Ā 
Testing the frontend
Testing the frontendTesting the frontend
Testing the frontend
Ā 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
Ā 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
Ā 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02
Ā 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)
Ā 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
Ā 
Practical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationPractical SQL query monitoring and optimization
Practical SQL query monitoring and optimization
Ā 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
Ā 
Productionalizing ML : Real Experience
Productionalizing ML : Real ExperienceProductionalizing ML : Real Experience
Productionalizing ML : Real Experience
Ā 
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Breaking Dependencies To Allow Unit Testing - Steve Smith | FalafelCON 2014
Ā 
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit TestingBreaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit Testing
Ā 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
Ā 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
Ā 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
Ā 
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
Ā 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJS
Ā 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
Ā 

More from Sander Mak (@Sander_Mak)

Scalable Application Development @ Picnic
Scalable Application Development @ PicnicScalable Application Development @ Picnic
Scalable Application Development @ PicnicSander Mak (@Sander_Mak)
Ā 
Event-sourced architectures with Akka
Event-sourced architectures with AkkaEvent-sourced architectures with Akka
Event-sourced architectures with AkkaSander Mak (@Sander_Mak)
Ā 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
Ā 
The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)Sander Mak (@Sander_Mak)
Ā 
Java 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the futureJava 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the futureSander Mak (@Sander_Mak)
Ā 
Elevate your webapps with Scala and Lift
Elevate your webapps with Scala and LiftElevate your webapps with Scala and Lift
Elevate your webapps with Scala and LiftSander Mak (@Sander_Mak)
Ā 

More from Sander Mak (@Sander_Mak) (20)

Scalable Application Development @ Picnic
Scalable Application Development @ PicnicScalable Application Development @ Picnic
Scalable Application Development @ Picnic
Ā 
Coding Your Way to Java 13
Coding Your Way to Java 13Coding Your Way to Java 13
Coding Your Way to Java 13
Ā 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
Ā 
Java Modularity: the Year After
Java Modularity: the Year AfterJava Modularity: the Year After
Java Modularity: the Year After
Ā 
Desiging for Modularity with Java 9
Desiging for Modularity with Java 9Desiging for Modularity with Java 9
Desiging for Modularity with Java 9
Ā 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
Ā 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
Ā 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
Ā 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
Ā 
Provisioning the IoT
Provisioning the IoTProvisioning the IoT
Provisioning the IoT
Ā 
Event-sourced architectures with Akka
Event-sourced architectures with AkkaEvent-sourced architectures with Akka
Event-sourced architectures with Akka
Ā 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
Ā 
The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)The Ultimate Dependency Manager Shootout (QCon NY 2014)
The Ultimate Dependency Manager Shootout (QCon NY 2014)
Ā 
Akka (BeJUG)
Akka (BeJUG)Akka (BeJUG)
Akka (BeJUG)
Ā 
Fork Join (BeJUG 2012)
Fork Join (BeJUG 2012)Fork Join (BeJUG 2012)
Fork Join (BeJUG 2012)
Ā 
Fork/Join for Fun and Profit!
Fork/Join for Fun and Profit!Fork/Join for Fun and Profit!
Fork/Join for Fun and Profit!
Ā 
Kscope11 recap
Kscope11 recapKscope11 recap
Kscope11 recap
Ā 
Java 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the futureJava 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the future
Ā 
Scala and Lift
Scala and LiftScala and Lift
Scala and Lift
Ā 
Elevate your webapps with Scala and Lift
Elevate your webapps with Scala and LiftElevate your webapps with Scala and Lift
Elevate your webapps with Scala and Lift
Ā 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Ā 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
Ā 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
Ā 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
Ā 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Ā 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
Ā 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
Ā 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
Ā 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
Ā 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
Ā 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
Ā 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
Ā 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
Ā 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
Ā 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
Ā 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Ā 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Ā 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
Ā 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Ā 
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort ServiceHot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Ā 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Ā 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Ā 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Ā 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Ā 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Ā 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Ā 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Ā 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
Ā 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
Ā 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Ā 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
Ā 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Ā 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Ā 

Hibernate Performance Tuning

  • 2. Hibernate sucks! ... because itā€™s slow
  • 3. Hibernate sucks! ... because itā€™s slow ā€˜The problem is sort of cultural [..] developers use Hibernate because they are uncomfortable with SQL and with RDBMSes. You should be very comfortable with SQL and JDBC before you start using Hibernate - Hibernate builds on JDBC, it doesnā€™t replace it. That is the cost of extra abstraction [..] save yourself effort, pay attention to the database at all stages of development.ā€™ - Gavin King (creator)
  • 4.
  • 5. ā€˜Most of the performance problems we have come up against have been solved not by code optimizations, but by adding new functionality.ā€™ - Gavin King (creator)
  • 6. ā€˜You can't communicate complexity, only an awareness of it.ā€™ - Alan J. Perlis (1st Turing Award winner)
  • 7. Outline Optimization Lazy loading Examples ā€˜from the trenchesā€™ Search queries Large collections Batching Odds & Ends
  • 9. Optimization is hard Performance blame Framework vs. You When to optimize? Preserve correctness at all times Unit tests ok, but not enough Automated integration tests
  • 10. Optimization is hard Performance blame Framework vs. You When to optimize? Preserve correctness at all times Unit tests ok, but not enough Automated integration tests Premature optimization is the root of all evil - Donald Knuth
  • 11. Optimization guidelines Measurement Ensure stable, production-like environment Measure time and space Time: isolate timings in different layers Space: more heap -> longer GC -> slower Try to measure in RDBMS as well IO statistics (hot cache or disk thrashing?) Query plans Make many measurements -> automation
  • 12. Optimization guidelines Practical Proļ¬ler on DAO/Session.query() methods VisualVM etc. for heap usage many commercial tools also have built-in JDBC proļ¬ling Hibernate JMX <property name="hibernate.generate_statistics">true </property> RDBMS monitoring tools
  • 13. Analyzing Hibernate Log SQL: <property name="show_sql">true</property> <property name="format_sql">true</property> Log4J conļ¬guration: org.hibernate.SQL -> DEBUG org.hibernate.type -> TRACE (see bound params) Or use P6Spy/Log4JDBC on JDBC connection
  • 14. Analyzing Hibernate 2011-07-28 09:57:12,061 DEBUG org.hibernate.SQL - insert into BASKET_LINE_ALLOC (LAST_UPDATED, QUANTITY, CUSTOMER_REF, NOTES, BRANCH_ID, FUND_ID, TEMPLATE_ID, BASKET_LINE_ALLOC_ID) values (?, ?, ?, ?, ?, ?, ?, ?) Log SQL: 2011-07-28 09:57:12,081 DEBUG org.hibernate.type.TimestampType - binding '2006-07-28 09:57:12' to parameter: 1 2011-07-28 09:57:12,081 DEBUG org.hibernate.type.IntegerType - binding '3' to parameter: 2 <property name="show_sql">true</property> 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 3 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 4 <property name="format_sql">true</property> 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '511' to parameter: 5 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '512' to parameter: 6 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding null to parameter: 7 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '180030' to parameter: 8 Hibernate: INSERT INTO mkyong.stock_transaction (CHANGE, CLOSE, DATE, OPEN, STOCK_ID, VOLUME) Log4J conļ¬guration: VALUES (?, ?, ?, ?, ?, ?) 2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '10.0' to parameter: 1 2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '1.1' to parameter: 2 2011-07-28 13:33:07,253 DEBUG DateType:133 - binding '30 December 2009' to parameter: 3 org.hibernate.SQL -> DEBUG 2011-07-28 13:33:07,269 DEBUG FloatType:133 - binding '1.2' to parameter: 4 2011-07-28 13:33:07,269 DEBUG IntegerType:133 - binding '11' to parameter: 5 2011-07-28 13:33:07,269 DEBUG LongType:133 - binding '1000000' to parameter: 6 2011-07-28 09:57:12,061 DEBUG org.hibernate.SQL - insert into BASKET_LINE_ALLOC (LAST_UPDATED, QUANTITY, CUSTOMER_REF, NOTES, BRANCH_ID, FUND_ID, TEMPLATE_ID, org.hibernate.type -> TRACE (see bound params) BASKET_LINE_ALLOC_ID) values (?, ?, ?, ?, ?, ?, ?, ?) 2011-07-28 09:57:12,081 DEBUG org.hibernate.type.TimestampType - binding '2006-07-28 09:57:12' to 2011-07-28 09:57:12,081 DEBUG org.hibernate.type.IntegerType - binding '3' to parameter: 2 parameter: 1 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 3 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.StringType - binding '' to parameter: 4 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '511' to parameter: 5 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '512' to parameter: 6 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding null to parameter: 7 Or use P6Spy/Log4JDBC on JDBC connection 2011-07-28 09:57:12,082 DEBUG org.hibernate.type.LongType - binding '180030' to parameter: 8 Hibernate: INSERT INTO mkyong.stock_transaction (CHANGE, CLOSE, DATE, OPEN, STOCK_ID, VOLUME) VALUES (?, ?, ?, ?, ?, ?) 2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '10.0' to parameter: 1 2011-07-28 13:33:07,253 DEBUG FloatType:133 - binding '1.1' to parameter: 2 2011-07-28 13:33:07,253 DEBUG DateType:133 - binding '30 December 2009' to parameter: 3 2011-07-28 13:33:07,269 DEBUG FloatType:133 - binding '1.2' to parameter: 4 2011-07-28 13:33:07,269 DEBUG IntegerType:133 - binding '11' to parameter: 5 2011-07-28 13:33:07,269 DEBUG LongType:133 - binding '1000000' to parameter: 6
  • 16. Lazy loading One entity to rule them all Request Mostly sane defaults: 1..1 @OneToOne, @OneToMany, User @ManyToMany: LAZY 1..* *..1 @ManyToOne : EAGER (Due to JPA spec.) Authorization Extra-lazy: Hibernate *..1 speciļ¬c Global Company 1..* Company
  • 17.
  • 19. Lazy loading N+1 Selects problem Select list of N users HQL: SELECT u FROM User Authorizations necessary: SQL 1 query: SELECT * FROM User N select queries on LEFT JOIN Company c Authorization executed! WHERE u.worksForCompany = c.id Solution: FETCH JOINS @Fetch(FetchMode.JOI N) @FetchProļ¬le (enable per session donā€™t call .size()
  • 20. Lazy loading N+1 Selects problem Select list of N users HQL: SELECT u FROM User Authorizations necessary: SQL N queries: SELECT * FROM Authorization N select queries on WHERE userId = N Authorization executed! Solution: FETCH JOINS @Fetch(FetchMode.JOI N) @FetchProļ¬le (enable per session donā€™t call .size()
  • 21. Lazy loading N+1 Selects problem HQL: SELECT u FROM User OUTER Select list of N users JOIN FETCH u.authorizations Authorizations necessary: SQL 1 query: N select queries on SELECT * FROM User Authorization executed! LEFT JOIN Company c LEFT OUTER JOIN Authorization Solution: ON .. WHERE u.worksForCompany = c.id FETCH JOINS @Fetch(FetchMode.JOI N) @FetchProļ¬le (enable per session donā€™t call .size()
  • 22. Lazy loading Some guidelines Laziness by default = mostly good However, architectural impact: Session lifetime (ā€˜OpenSessionInViewā€™ pattern) Extended Persistence Context Proxy usage (runtime code generation) Eagerness can be forced with HQL/JPAQL/Criteria But eagerness cannot be reverted exception: Session.load()/EntityManager.getReference()
  • 24. Search queries Search User Result list 1..* *..1 Authorization *..1 Global 1..* Company Company Detail
  • 25. Search queries Obvious solution: Too much information! Use summary objects: UserSummary = POJO not attached, only necessary ļ¬elds (no relations)
  • 26. Search queries Obvious solution: Too much information! Use summary objects: UserSummary = POJO not attached, only necessary ļ¬elds (no relations) Or: drop down to JDBC to fetch id + ļ¬elds
  • 27. Search queries Alternative: Taking it further: Pagination in queries, not in app. code Extra count query may be necessary (totals) Ordering necessary for paging!
  • 28. Search queries Subtle: Alternative: effect of applying setMaxResults ā€œThe or setFirstResult to a query involving fetch joins over collections is undeļ¬nedā€ Taking it further: Cause: the emitted join possibly returns several rows per entity. So LIMIT, rownums, TOP cannot be used! Instead Hibernate must fetch all rows WARNING: firstResult/maxResults specified with Pagination in queries, not in app. code collection fetch; applying in memory! Extra count query may be necessary (totals) Ordering necessary for paging!
  • 29. Analytics & reporting ORM less relevant: no entities, but complex aggregations Simple sum/avg/counts possible over entities Specialized db calls for complex reports: Partitioning/windowing etc. Integrate using native query Or create a database view and map entity
  • 31. Large collections Frontend: Request CompanyGroup 1..* Backend: Company CompanyGroup 1..* Meta-data Company read-only entity, CompanyInGroup backed by expensive view *..1 Company
  • 32. Large collections Frontend: Request CompanyGroup 1..* Backend: Company CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 33. Large collections Frontend: Request CompanyGroup 1..* Backend: Company CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 34. Large collections Opening large groups sluggish Improved performance: Fetches many uninitialized collections in 1 query Also possible on entity: Request CompanyGroup 1..* Company
  • 35. Large collections Opening large groups sluggish Improved performance: Fetches many uninitialized collections in 1 query Also possible on entity: Request CompanyGroup 1..* Company Better solution in hindsight: fetch join
  • 36. Large collections Extra lazy collection fetching Efļ¬cient: companies.size() -> count query companies.contains() -> select 1 where ... companies.get(n) -> select * where index = n
  • 37. Large collections Saving large group slow: >15 sec. Problem: Hibernate inserts row by row Query creation overhead, network latency Solution: <property name="hibernate.jdbc.batch_size">100 </property> Enables JDBC batched statements Caution: global property Request CompanyGroup Also: <property name="hibernate.order_inserts">true 1..* </property> Company <property name="hibernate.order_updates">true </property>
  • 38. Large collections Frontend: Request CompanyGroup 1..* Backend: Company CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 39. Large collections Backend: CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 40. Large collections Process CreateGroup (Soap) Business Service Service CreateGroup: ~10 min. for thousands of companies @BatchSize on Company improved demarshalling JDBC batch_size property marginal improvement INFO: INSERT INTO CompanyInGroup VALUES (?,...,?) INFO: SELECT @identity INFO: INSERT INTO CompanyInGroup VALUES (?,...,?) INFO: SELECT @identity .. 1000 times CompanyGroup 1..* Meta-data Insert/select interleaved: due to gen. id CompanyInGroup *..1 Company
  • 41. Large collections Process CreateGroup (Soap) Business Service Service Solution: generate id in app. (not always feasible) Running in ~3 minutes with batched inserts Next problem: heap usage spiking Use StatelessSession āœ¦ Bypass ļ¬rst-level cache āœ¦ No automatic dirty checking CompanyGroup āœ¦ Bypass Hibernate event model and interceptors 1..* Meta-data āœ¦ No cascading of operations CompanyInGroup āœ¦ Collections on entities are ignored *..1 Company
  • 42. Large collections Process CreateGroup (Soap) Business Service Service Solution: generate id in app. (not always feasible) Running in ~3 minutes with batched inserts Next problem: heap usage spiking Use StatelessSession CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 43. Large collections Process CreateGroup (Soap) Business Service Service Now <1 min., everybody happy! CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 44. Large collections Process CreateGroup (Soap) Business Service Service Now <1 min., everybody happy! Data loss detected! CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 45. Large collections Process CreateGroup (Soap) Business Service Service Data loss detected! StatelessSession and JDBC batch_size bug HHH-4042: Closed, wonā€™t ļ¬x : CompanyGroup 1..* Meta-data CompanyInGroup *..1 Company
  • 47. Dirty little secret validated(item) performs read-only queries select currentItem from Catalog where .. Dirty collection after select spendingLimit from User where .. each iteration insert into Item values (?, ?, ?) select currentItem from Catalog where .. select spendingLimit from User where .. Batching fails insert into Item values (?, ?, ?) Flushmode.AUTO Loops always suspect: relational, set-based thinking
  • 48. Dirty little secret validated(item) performs read-only queries Dirty collection after each iteration Batching fails Flushmode.AUTO Loops always suspect: relational, set-based thinking
  • 49. Query hints Speed up read-only service calls: Hibernate Query.setHint(): Also: never use 2nd level cache just ā€˜because we canā€™
  • 50. Query hints Speed up read-only service calls: Hibernate Query.setHint(): Also: never use 2nd level cache just ā€˜because we canā€™ @org.hibernate.annotations.Immutable
  • 51. Large updates Naive approach: Entities are not always necessary: Changes are not reļ¬‚ected in persistence context With optimistic concurrency: VERSIONED keyword
  • 52. Large updates Naive approach: Entities are not always necessary: Changes are not reļ¬‚ected in persistence context With optimistic concurrency: VERSIONED keyword Consider use of stored procedures
  • 53. Cherish your database Data and schema outlive your application Good indexes make a world of difference Stored procedures etc. are not inherently evil Do not let Hibernate dictate your schema Befriend a DBA instead! There are other solutions (there I said it) MyBatis Squeryl (Scala)
  • 54. Thanks for listening! @Sander_Mak Join me later today: Elevate your webapps with Scala & Lift! 17:00 Room C branchandbound.net

Editor's Notes

  1. Sander Mak - lead developer Java - Info Support\nDutch accent\nHibernate experience, not committer who knows everything\n
  2. Q: who has heard / said / thought this?\nLeaky abstraction -&gt; not going to defend ORM, many advantages\n1) mapping problems -&gt; impedance mismatch\n2) performance problems -&gt; stop treating Hibernate as blackbox!!\n
  3. Tangle of 37\nRed = bad -&gt; cyclic dependency\nHibernate implementation complex, but battle-tested \nJPA tutorials rosy picture: Using Hibernate can be quite hard!\n
  4. Tangle of 37\nRed = bad -&gt; cyclic dependency\nHibernate implementation complex, but battle-tested \nJPA tutorials rosy picture: Using Hibernate can be quite hard!\n
  5. Tangle of 37\nRed = bad -&gt; cyclic dependency\nHibernate implementation complex, but battle-tested \nJPA tutorials rosy picture: Using Hibernate can be quite hard!\n
  6. Examples use Hibernate/JPA API interchangeably: start with JPA, you will Hibernate specifics\n\n
  7. \n
  8. Tuning performance is a bit like refactoring: don&amp;#x2019;t change the semantics, just the how.\n\nPreserving correctness: unit tests! However, the more you reach the edges of the DBMS, the easier you will hit an obscure bug in query optimizer, caching strategy etc.\n\n
  9. Know your RDBMS! Database independence is nice when porting is necessary, but focus on particular DB for production situation (document!), that is what counts!\n (once you get into nitty-gritty opt. details, you will have to know the RDBMS intimately)\nIndex, covering indexes, locking strategies, &amp;#x2018;vacuuming&amp;#x2019;/&amp;#x2018;transaction logs&amp;#x2019;/reset statistics\n
  10. Hardware vs. virtualized, real data volumes, simulate real workloads\n
  11. SQL Server mgmt studio\n
  12. Question hear most often: how to see parameter values\n
  13. \n
  14. Beware: you might retrieve your whole database in one go...\n\nCode example: will load Company eager, Auths. lazy\nExtra-lazy: discuss later with large collections\n
  15. First encounter with lazy loading :)\n\nExtended persistence contexts, OpenSessionInView pattern and other band-aids\n\n
  16. First encounter with lazy loading :)\n\nExtended persistence contexts, OpenSessionInView pattern and other band-aids\n\n
  17. First encounter with lazy loading :)\n\nExtended persistence contexts, OpenSessionInView pattern and other band-aids\n\n
  18. Eager vs. lazy is contract specifying WHEN relations are retrieved, not HOW. For the HOW you can define fetching strategies.\n\nAlso possible to define fetch join on Criteria queries\n\n\n\n\n
  19. Eager vs. lazy is contract specifying WHEN relations are retrieved, not HOW. For the HOW you can define fetching strategies.\n\nAlso possible to define fetch join on Criteria queries\n\n\n\n\n
  20. Eager vs. lazy is contract specifying WHEN relations are retrieved, not HOW. For the HOW you can define fetching strategies.\n\nAlso possible to define fetch join on Criteria queries\n\n\n\n\n
  21. Eager vs. lazy is contract specifying WHEN relations are retrieved, not HOW. For the HOW you can define fetching strategies.\n\nAlso possible to define fetch join on Criteria queries\n\n\n\n\n
  22. Eager vs. lazy is contract specifying WHEN relations are retrieved, not HOW. For the HOW you can define fetching strategies.\n\nAlso possible to define fetch join on Criteria queries\n\n\n\n\n
  23. Eager vs. lazy is contract specifying WHEN relations are retrieved, not HOW. For the HOW you can define fetching strategies.\n\nAlso possible to define fetch join on Criteria queries\n\n\n\n\n
  24. Lazy as default, tune eager loading in queries specifically for your usecase (DAO pattern not that bad after all)\n
  25. \n
  26. \n
  27. Zelfde overwegingen gelden voor reporting queries, zoveel mogelijk in de query oplossen en geen entities teruggeven als niet nodig\n
  28. \n
  29. Zelfde overwegingen gelden voor reporting queries, zoveel mogelijk in de query oplossen en geen entities teruggeven als niet nodig\n
  30. Hibernate is specifically not for bulk manipulation: use stored procs for that. But when is something bulk? Collections with thousands of elements routinely in OLTP applications.\n
  31. \n
  32. \n
  33. \n
  34. \n
  35. Example: 20 groups with uninitialized collections, access first collection: all are initialized with 1 query.\nMeasured: opening first group was slightly slower, general user experience better\n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. stateless session ideaal for fire-and-forget service calls, minder in user-facing applicatie waar consistent houden persistence context van belang is.\n
  44. stateless session ideaal for fire-and-forget service calls, minder in user-facing applicatie waar consistent houden persistence context van belang is.\n
  45. \n
  46. \n
  47. \n
  48. Only &amp;#x2018;full batches&amp;#x2019; were performed\n
  49. \n
  50. Each item is flushed automatically before doing the lookup queries, because the collection becomes dirty after adding element\n
  51. Each item is flushed automatically before doing the lookup queries, because the collection becomes dirty after adding element\n
  52. Hibernate does some optimizing for read-only entities:\nIt saves execution time by not dirty-checking simple properties or single-ended associations. \nIt saves memory by deleting database snapshot\n\ncache increases load on memory, possibly more GC pauses for app. if co-located with application\n
  53. Interesting: all instances of entity are evicted from second level cache with such a query, even if WHERE clause limits affected entities\nAlso, no events fired as Hibernate normally would do.\n
  54. Interesting: all instances of entity are evicted from second level cache with such a query, even if WHERE clause limits affected entities\nAlso, no events fired as Hibernate normally would do.\n
  55. \n
  56. \n