title: using j2ee to load BLOB always gets null for BLOB attribute of entity bean
body: <p>I want to load a BLOB from database using EJB.</p>
  
  <p>Problem: The BLOB attribute is alsways null.</p>
  
  <p>The blob attribute looks like this in the bean:</p>
  
  <pre><code>@Column(name = "REPORT_PARAMETER", length = 50000) // tried already: removing "length"
  @Lob
  @Basic(fetch = FetchType.EAGER) // tried already: uncomment, changing to "LAZY"
  private byte[] reportParameters;
  </code></pre>
  
  <p>I load the bean like this:</p>
  
  <pre><code>TestCacheDataBE data= (TestCacheDataBE) em.find(TestCacheDataBE.class, cacheId);
  </code></pre>
  
  <p>The loading works, I can read all the other attributes fine. Only the BLOB attribute is always null.</p>
  
  <p>There is data in the database. A SELECT shows me the BLOB column is not null.</p>
  
  <pre><code>select dbms_lob.getlength(report_parameter)
  from T_REPORT_CACHE;
  </code></pre>
  
  <p>The above statement shows me, there is data in the BLOB column.</p>
  
  <p>The data is saved using also the bean and entitymanager like this:</p>
  
  <pre><code>em.persist(data);
  </code></pre>
  
  <p>But the saving works fine! </p>
  
  <p>So the only problem is loading the BLOB data from the database into the bean. Saving works, and loading all the other data works also.</p>
  
  <p>I use weblogic 10, Java 1.5.</p>