R
R
Riard Brugekaaim2015-04-28 09:58:09
Java
Riard Brugekaaim, 2015-04-28 09:58:09

Is it obligatory in hibernate to close the request with the “begin/commit” bundle?

The question is not so much this, but:
If I request data without a bunch

session.beginTransaction();
session.getTransaction().commit();

will it give me data from the first request (even if I changed something in the database after it) or will it still request new ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Pavlov, 2015-04-28
@OLDRihard

No, not necessarily.
This indicates that you are starting a new transaction.
The Select request in that case will produce to you the old data if Insert happened in other transaction and new if in the same.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question