Hi everyone,
I'm using Hibernate 3.3.1 (version that comes with JBoss) with annotations. In our application we need lazy loaded properties for large binary objects. Unfortunately I cannot provide an isolated simplified example.
In the persistent class OriginalSubmission the property blob is defined as follows:
Code:
@Lob
@Basic( fetch = FetchType.LAZY) // Hibernate book p. 572, bottom!
@Column( name = "bin_data",
nullable = false,
unique = false,
insertable = true,
updatable = true
)
public java.sql.Blob getBlob()
throws IMException
{
return blobM;
}
According to the Hibernate documentation, build-time byte code instrumentation is required in order to allow for lazily loaded properties. The build steps have been extended correspondingly (InstumentTask) with the consequence that the code is instrumented. However, in practice the property blob now is never really löoaded by Hibernate, even not when directly accessed, rather null is returned instead.
At runtime, Hibernate logs show something like
Quote:
- lazy property fetching available for: com.l1id.......OriginalSubmission
Also, when debugging, class OriginalSubmission contains a field named $CGLIB_READ_WRITE_CALLBACK which seems to implement the field interceptor. It contains a HashMap in which the uninitialized blob property is correctly listed. However it seems that this interceptor is never really called.
I'm completely stuck here after several days of experimenting. I have read the following information:
I have patched hibernate-annotations-3.4.0.GA.jar as described in ANN-782 and tried any conceivable combinations regarding the repackaing issue. Also a lot of documentation seems to be out of date, it is a nightmare. Whatever I do, the interceptor is not called and the lazy-loaded-properties are not populated.
Using another version of Hibernate which could be based on cglib-2.2 is not acceptable because this project relates to JBoss-5.0.0 GA. Even JBoss 5.1.0 GA uses still Hibernate-3.3.1 GA. We need to use this very version.
I conclude, since very few people seem to encounter this situation, that I doing something really wrong, maybe an obvious triviality. I really would appreciate comments or recommendations about this.
- Can I debug into the interceptor method?
- What can cause the fact that it is not called at all
Thanks in advance for your help,
-Rainer