Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes efficient way to perform CRUD operation in Oracle TopLink Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "efficient way to perform CRUD operation in Oracle TopLink" Watch "efficient way to perform CRUD operation in Oracle TopLink" New topic
Author

efficient way to perform CRUD operation in Oracle TopLink

anish jain
Ranch Hand

Joined: Feb 03, 2010
Posts: 129
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

Joined: Oct 01, 2007
Posts: 553
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



TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
 
 
subject: efficient way to perform CRUD operation in Oracle TopLink
 
Similar Threads
Convert List to ResultSet?
The future of Hibernate in Spring
Oracle TopLink working on 64-bit java?
Excel Data Population using Java
Calling stored procedures from EJB using JPA, is this possible ?