I
I
Ilya2020-06-26 23:30:16
Java
Ilya, 2020-06-26 23:30:16

Which is better: one long session or one session per transaction?

What is better, to create one session by SessionFactory.openSession() and use it while the application is alive and not to score close() at the end, or every time you need to make a transaction, open a session, make a transaction, commit and close the session until a new one is needed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question