• Post Reply Bookmark Topic Watch Topic
  • New Topic

Lazy Loading of a COLUMN in database  RSS feed

 
Priyank kumar Tiwari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,

I understand we can use lazy loading to avoid the loading of whole bean in case of a foreign key constraints with other bean.But Is their any way i can lazy load(at Column level) just a particular column in a CMR entity bean.I have one of the column a CLOB which is actually a xml ,but everytime when I retrieve that tables Local i really dont want to load that CLOB column ..is their any way to delay that ?

Thanks in advance,
Priyank
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Priyank,

As far as I know ejb finder defaults to lazy loading. This means that the container will do one select to retrieve all primary keys and will load each bean if a getter is invoked (remember the infamous n+1 select problem). Of course containers will allow you to invalidate this behaviour and WebLogic has a special flag that can be set for each finder (finder-loads-bean I guess) that will provide an eagerly loading (loading the entire data with only one huge select). Now I hope your question is related to finders and I also hope you�re using WebLogic. If that�s the case than WebLogic provides a solution to your problem. The container allows grouping related fields in fields group. The advantage of this technique is that the bean data will get fetch after invoking a specific getter. The container will fetch only the fields that are in the same field group.
Regards.
 
Priyank kumar Tiwari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi valentin,

Yes I am using weblogic and I was actually concerned with finders only .Whatever you said makes sense to me ,I had a similar notion though ,but dont know how to confirm that whatever we are thinking is right ,and is actually not eating up lot of time whenever I load that bean .So I will do some more research on that and will get back soon .Thanks a lot for your suggestion .

Priyank
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!