cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Clegg" <>
Subject Manually generating XML for response
Date Tue, 23 Sep 2008 14:39:24 GMT
Hi folks,

I have a web service that pulls large result sets from a database --
of the order of 10,000-100,000 rows per query, from an 80M row table.

Each record is two short strings and two doubles.

The query itself runs in about 3-5s, and my initial approach has a
data access object which iterates through the result set and produces
a simple Java object for each record on request. My service, which I
haven't finished yet, was going to invoke this DAO and build a list of
the corresponding JAXB objects to be passed back to the client. Nice
clean separation, with the database-specific DAO not depending on the
web service or its databindings.

However, for my test query (returning 85,000 rows) it takes around 10
seconds total to iteratively produce a POJO for each one in the DAO,
and to this I'll need to add a similar amount of time to create the
list of equivalent JAXB objects, plus the additional overhead of
serializing them.

So I'm thinking -- why not 'cheat' and have the database stored
procedure return appropriately formatted XML which can just be
inserted into a response message?

I'm not sure how you would go about doing this in CXF -- would this be
a job for a custom interceptor in the outgoing chain? If anyone can
point me in the direction of an example which would give me a starting
point, I'd be very grateful.

Many thanks!


View raw message