What is a database session?

前端 未结 2 1236
闹比i
闹比i 2021-02-02 10:44

I understand a general understanding of the concept of a database transaction. We access a database within transaction to ensure ACID properties.

In Hibernate there is a

2条回答
  •  走了就别回头了
    2021-02-02 11:20

    @Dmitry has answered very nicely.

    Another way to look at the session is as Instance of Database Usage. When you create a session, you have a context ready for any database interaction with support services (e.g. transaction, caching, connection etc) required therein. A transaction is an independent service used within the session.

    Also the session is the first level cache used by the typical OR mapping tools like hibernate. Session acts as temporary context created upon request to facilitate a DB interaction.

提交回复
热议问题