Quantcast
Channel: Oracle/Java/Others
Viewing all articles
Browse latest Browse all 10

ORM tools by Hongfeng Sun

$
0
0

Writing about web page /java/entry/java_connection_pool/

Writing about an entry you don't have permission to view

Object Relational Mapping (ORM) Tools provide a slick way of persisting objects (data) into database. It has a great impact on Java applications. It reduces the need for developers to write native SQL. The developers can easily let the tools generated complicated SQL. To achieve there program efficiency, developer tend to join several objects, without realizing it will generated a huge SQL require multiple table joins. For DBAs, it means they need to improve performance tuning skills. Oracle optimizer might choose inferior execution plan for a big query.

As a DBA, aware of the following point:

  • Using native SQL in corner cases 90/10. ORM tools is good for manipulate data. For batch loading, updating, deleting, it is far better to use native SQL. For instance, to display all information of several parents and their children, a Java application is likely to loop over every parent to get his children. This way will generate a lot of hit to database. With native SQL, you can easily get this information in one single SQL.
    Some tools provide semi-native portable SQL, for instance, hibernate has HQL, EJB has EJB-QL, you might encourage developer to use them as well.
  • Use lazy loading to avoid generated tons of SQL. Suppose a parent has many children, every child has its own children. If you just want to get information fom a child, with eager loading, this child will automatically load its children. This can leads to generate several queries.
  • break down one complicated big SQL into two or more SQLs.

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images