E
E
Eugene2018-05-02 01:06:30
Java
Eugene, 2018-05-02 01:06:30

Why is data lost on the client?

I transfer an object from the client to the server, the entity of the database table, it has a One To Many relationship. I use hibernate to communicate with the database. Through the debugger, I see that everything is in order on the server, all the data is in place:
5ae8e31c102fd365956914.png
But on the client there is already an exception:
5ae8e3e9df8d2661309311.png
The code that I use for transmission:
serializer.writeObject(orderHeaders);

orderHeaders = (ArrayList<OrderHeaderEntity>) deserializer.readObject();

I suspect that this is due to the fact that I am passing an object that is too large in size. Is there any way to control this maximum size?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vanyamba-electronics, 2018-05-02
@vanyamba-electronics

Nested data must be passed in several requests. The parser built into the browser cannot parse sublevels. In some browsers it can, but this is not the rule.

C
Conacry, 2018-05-05
@Conacry

Hello.
Dig into the topic "hibernate lazy initialization" (If you're using it in relation to One to Many - fetch = FetchType.LAZY). The problem is that the associated object is not loaded from the database (here you need to read about proxy objects in hibernate).
To explicitly initialize an object from the DB, I used:
Hibernate.initialize(Object obj)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question