omkar sirra
omkar sirra

Reputation: 726

can i flush the session after closing the session in hibernate?

session.close();
session.flush();

Which gave an exception Session is closed.

Or Should we flush the session before closing the session only.

Upvotes: 0

Views: 188

Answers (1)

Vish
Vish

Reputation: 879

No..session should be flushed before closing connection. Session flush basically synchronize cache data with database without committing data and flush should be called inside transaction

Upvotes: 2

Related Questions