ObjectDB ObjectDB

EntityManager to closed

#1

Hi I understand we should close the entitymanager after each use, and close the factory after the program is done.  But I have a question.  Let’s say I have a objdb server running in Clint server mode.  I am just running some test cases and opened up 100 entitymanager via factory.createEntityManager().  But I didn’t bother closing them, nor did I close the factory.  I just ran the program for a test and then the program is ended and terminated.

Will my server now have I closed sockets or some kind of resource leaked or will it be handled automatically?

 

edit
delete
#2

Usually it should be fine, as the server can identify disconnections and handle them automatically (in some specific cases, it is possible that some locks will not be released, at least for a while). The issue with not closing EntityManager and EntityManagerFactory instances is mainly wasted resources on the client side.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.