You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tom Cassimon <to...@gmail.com> on 2009/09/08 17:49:36 UTC
Apache CXF & Lazy Loading
Hi,
I use the combination Hibernate, Spring & Apache CXF and I am wondering
if Apache CXF supports lazy loading, and if it does how do i configure it.
I have Entity class with a BLOB column (defined as byte[]). It's annotated
with:
@Column(name = "data", columnDefinition="longblob")
@Basic(fetch=FetchType.LAZY)
But when I am on client side and look at the messages coming in & out it
requests
the lazy loaded variable directly with the first call. Can I somehow define
it as lazy
loaded in Apache CXF (or maybe spring)?
Regards,
Tom
Re: Apache CXF & Lazy Loading
Posted by K1001010 <ke...@monsanto.com>.
In general your JDBC driver's concrete implementation of Blob should itself
provide lazy loading.
That is, if you have a setter for the blob, hibernate sets the Blob, the the
stream is not read until you call getBlob().getInputSream().readXXX();
HOWEVER. In my case I was doing the following in the setter:
dataSource = new AttachmentDataSource("application/octet-stream",
blob.getInputStream());
And the AttachmentDataSource was reading the entire Blob, hence no lazy
loading. This was fixed though, when I upgraded from CXF 2.2.2 to to
2.2.3.
Tom Cassimon-2 wrote:
>
> Hi,
>
> I use the combination Hibernate, Spring & Apache CXF and I am wondering
> if Apache CXF supports lazy loading, and if it does how do i configure it.
>
> I have Entity class with a BLOB column (defined as byte[]). It's annotated
>
--
View this message in context: http://www.nabble.com/Apache-CXF---Lazy-Loading-tp25349134p25575728.html
Sent from the cxf-user mailing list archive at Nabble.com.