• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JPA Using @Lob and lazyfetch option

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As according to JPA recommendations, I am using the @Lob on the ''image' field which is of type byte[] and fetch type is lazy.

public class Member implements Serializable {
...........

@Lob
@Basic(fetch=FetchType.LAZY,optional=true)
@Column(name = "image")
private byte[] image;

...........
}



According to this, when I query, the images must not be loaded into memory as its Lazy fetch but still they are being loaded.
I am using Hibernate as persistence provider. what can be the problem?

Thanks
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic