Multiple choice technology programming languages

Which statement is correct ?

  1. A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed

  2. A Session will obtain a JDBC Connection (or a Datasource) on object create

  3. A Session has no relation with JDBC Connection (or a Datasource)

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A Hibernate Session obtains a JDBC connection lazily - only when it's actually needed for an operation. This improves efficiency by avoiding unnecessary database connections. The session doesn't grab a connection at creation time.

AI explanation

Hibernate Sessions are designed to lazily acquire a JDBC Connection (or Datasource) only when database access is actually required — for example, when a query executes or a flush happens — rather than immediately upon Session creation, which helps conserve connection pool resources.