Batch Process Hibernation: VS Standing Session Normal Session Initial Request

As I understand it, stateless sessions are still preferable when using batch processes, since it simply separates the objects that execute this process. This way the constant context and cache will be free, so batch processes are a simple case. It is widely known as a simple JDBC Query Engine with queries translated to SQL queries immediately. Link to: stack overflow

On the other hand, I found out that my own queries do the same thing as I see that a session without saving data can match the result with the entity. Native queries do not do this until the box explicitly provides.

So, is there another difference in terms of performance, which is better when performing batch processes?

+4
source share
3 answers

If in batch processing you mean modifying entities on the database server using the SQL query itself (for example, UPDATE things SET daily_quota=15), then native SQL is faster. However, in this case you are not loading any objects, so in reality this is not like your question.

If during batch processing you mean modifying entities in your program (for example, load all instances Thing, change the attribute dailyQuotato 15) and write an update, then you will need a session without saving.

. . ( ), .

, , ORM .

+3

, , , . , .

, , . , , .

, persist, merge ..... , . .

, , - ..... . , .

, , - tghe - . , SQL- -, sql, JOOQL.

, , , SLA . 2000 16 cpus Hibernate .

, , JOQL, SQL, ORM.

+2

, , . , , , , Hibernate, .. .

, , , , . , . , .

, , , , . :

:

  • ,

, , - , .

, JDBC, , , , .

+1

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


All Articles