What happens if I load an entity saying session.load() and close the session without beginning a transaction & comitting it I gone through various sites, but couldn't find any good explanation.
If i understood your question correctly, you want to know the effect of reading an entity without having any transaction. If so, then there is no adverse effect. Transactions are supposed to be used where you are making any kind of change in the database (like insert/update/delete operations). Just to read an Entity, transaction should not be used.
In the following post it says, if we access an entity in non-transactional way, we need to enable auto-commit in hibernate configuration.
If not, once we close the session (we used for retrieving the entity) the database connection returning to the pool will have some issues/memory leaks.
lines in this link "the connection is in whatever mode it is by default after obtained from the pool, and returned there without commit or rollback. The behavior is then undefined."
kindly make me clear here.
Post by:autobot
Every plan is a little cooler if you have a blimp. And a tiny ad.
a bit of art, as a gift, the permaculture playing cards