• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

efficient way to perform CRUD operation in Oracle TopLink

 
anish jain
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to Oracle TopLink
Can anybody tell me which is the most efficient way to insert/update/select operations in database? (session,custom sql,named query)
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This depends what you are doing. I would recommend you start by using the most standard way, and then optimize things if necessary.

So, map your objects using JPA, and persist them using the JPA EntityManager API, and query them using JPQL queries.

There are plenty of optimization you can use,

See,
http://wiki.eclipse.org/EclipseLink/Performance

The most important ones are:
- using caching effectively
- using LAZY relationships
- using named queries, only using dynamic queries when required
- use sequence or table sequence with prellocation
- use batch writing
- use batch fetching or join fetching to retrieve related objects when required
- use parametrized SQL with statement caching
- ensure connection pooling is being used effectively
- ensure change tracking is being used
- use read-only queries when you only need read-only data


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic