• Post Reply Bookmark Topic Watch Topic
  • New Topic

fetching the record  RSS feed

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just need to fetch record which is a simple fecth, which one is better to write a sql query in session bean or to use the finder methods and retrieve record ?
Thanks aakash
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using CMP or BMP Entity Beans ? Obviously CMP is easier(if you are good with EJB QL), but if you are using BMP, might as well use session beans(either or actually) since you are going to write SQL.
-Sri
 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sri,
I am using CMP which is called by Session bean. so according to performance which one is better as my table will have many records
1) EJB Ql
2) Select query in session bean directly
thanks,
aakash
 
Parijat Mukherjee
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think u shud use a sql query in the session bean as it will take lesser resources
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use direct SQls only for displaying data in tabular format.
For displaying large volume of data if we use EJb-Qls , we will anyways end up rewriting the whole thing again in SQl
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For displaying large volume of data if we use EJb-Qls , we will anyways end up rewriting the whole thing again in SQl

Can you please explain?
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:

Can you please explain?

running finders with EJBQLs work just fine initially. Moment the customer data gets in , it just does'nt scale thereby forcing a rewrite.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!