Amit
Amit

Reputation: 495

Hibernate Connection Call Count

I read somewhere commit=flush+commit.

I only know that when we call session.flush() our statements are execute in database but not committed.

Suppose we don't call flush() method on session object and if we call commit method....it will internally do the work of executing statements on the database and then committing.

commit=flush+commit (in case of functionality)

I am curious about how many network connection this will create.

Upvotes: 0

Views: 87

Answers (1)

codedabbler
codedabbler

Reputation: 1261

I am curious about how many network connection this will create.

Typically one is interested in the number of SQL calls being made to the database. As that relates to identifying any performance issues/bottlenecks. This information is dependent on your specific domain model and the amount of data being queried/modified.

All these calls will be executed through a single SQL connection to the database. So there will be a single network connection per commit (unless you are working with a distributed transaction which is a rare scenario).

Upvotes: 2

Related Questions