Memory Error with Jax Jax-RS

I am returning a large amount of data through the recreation service. The query returns about 200,000 rows of data and is then converted to XML. When I start this service in IE8, I get the error message "there is not enough storage to complete this operation."

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

The database starts the query after about 5 seconds, so I assume the problem is converting JAXB to xml.

Does anyone have any ideas to improve this?

+3
source share
1 answer

Problem

, JPA , JAXB. , JPA , , . , JAXB , , .

№1 -

- URI, :

JPA:

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

№ 2 -

, . , :

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

: , URI. JAXB XmlAdapter.

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

XmlAdapter . :

+1

Source: https://habr.com/ru/post/1778128/


All Articles