I am new to sleep mode and started to learn sleep mode. The chapter I'm going to use sleep mode with JDBC (). Does hibernate use internal jdbc or JTA to perform persistence and perform operations? But I also see the JTA mentioned here, similar to the getCurrentSeessionSession () method, which receives the session associated with the current JTA transaction. Question: - Basically, I want to understand the role of JTA and jdbc here in sleep mode.
Question2: - I see below a code fragment in any operation in sleep mode
try{ session=factory.openSession(); tx=session.beginTransaction(); session.save(myClass); tx.commit(); } finally{ session.close(); }
Here I want to understand the role of the string // tx = session.beginTransaction (); In accordance with the understanding, each session will use one connection. So even if we start several transactions from the same session, we will use the same connection. after we complete a transaction for each transaction created from the same session, it will be executed once. So what are we trying to achieve with // tx = session.beginTransaction ();
hibernate
M sach
source share