I'm new to hibernate. Can anybody explain me what it means when we say, 'Hibernate works in managed and unmanaged environment'?
What is managed and unmanaged environment mean?
Thanks in advance,
-Uday
I am not sure about specific context you heard it in. But usually when we say 'managed environment' it means that there is some external container that operates things on your behalf. And in 'unmanaged' case you have do do work to manage your object lifecycle yourself.
For example, if you just use Hibernate by itself, you would need to create session, do your operation and close session. So it is unmanaged
since you have to manage it yourself.
However, if you use Hibernate inside Spring container, session open and close will be taken care of for you by Spring. In this case, it is managed
for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With