Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3483264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:39:14+00:00 2026-05-18T10:39:14+00:00

I am returning a large amount of data via a rest service. The query

  • 0

I am returning a large amount of data via a rest service. The query returns about 200,000 rows of data then gets converted to XML. When I run this service in IE8 I get an error that “there is not enough storage to complete this operation”.

Is there any best practice for returning a large amout of data this way?

The database run the query in about 5 seconds, so I’m guessing that the problem is JAXB converting it to xml.

Does anyone have any ideas to improve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:39:15+00:00Added an answer on May 18, 2026 at 10:39 am

    The Problem

    I’m assuming that you are using JPA to get your data as objects that can be handled by JAXB. If this is the case the JPA objects may be using lazy loading meaning that a query may not realize all the data at once. However as the JAXB implementation traverses the object graph, more and more of it is brought into memory until you run out.

    Option #1 – Provide Data in Chunks

    One approach is to return your data in chunks and offer a URI like the one below:

    • http://www.example.com/customers?start=10&size=100

    These parameters tie in very nicely to JPA query settings:

    namedQuery.setFirstResult(10);
    namedQuery.setMaxResults(100);
    

    Option #2 – Provide Links to Get More Data

    Alternatively, instead of including all the data you can provide links to get more. For example instead of:

    <purchase-order>
        <product id="1">
            <name>...</name>
            <price>...</price>
            ...
        </product>
        <product id="2">
            <name>...</name>
            <price>...</price>
            ...
        </product>
        ...
    </purchase-order>
    

    You could return the following, the client can then request details on products using the provided URI. You can map this in JAXB using an XmlAdapter.

    <purchase-order>
        <product>http://www.example.com/products/1</product>
        <product>http://www.example.com/products/2</product>
        ...
    </purchase-order>
    

    For more information on XmlAdapter see:

    • http://bdoughan.blogspot.com/2010/07/xmladapter-jaxbs-secret-weapon.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an app to serve large amounts of data via REST API and
The following query returns data right away: SELECT time, value from data order by
I have an app that potentially tracks a large amount of data during app
I have a query returning large XML, its size can reach 1GB in extreme
So I have a large JSON object i'm returning from the server, then building
I have the following PLSQL functions that returns following error when returning a large
I want to send a large amount of data to a server using NSURLConnection
I have to migrate a large amount of existing data in a Postgres DB
Scenario A very large size query returns a lot of fields from multiple joined
I have a service returning an array of type BaseItem. BaseItem has N subtypes.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.