2

I am using the Apache Chemistry API to create client sessions. The SessionFactory allows the creation of sessions but does not provide a way of closing them. What is the correct way to go about closing created sessions?

net_j
  • 205
  • 2
  • 9

1 Answers1

6

Not quite sure what you have in mind when you say close, but I assume you mean releasing resources.

The session is a stateful thing which amongst other things caches and holds authentication. It does not require any special clean up. If you want to get rid of it, just release the reference and let garbage collection kick in. There is no need to worry about network connections or (seriously sized) state on the server.

Andreas Steffan
  • 6,039
  • 2
  • 23
  • 25
  • Yes, thank you. For some reason, I do seem to be running into database running out of connections after awhile and not sure what is causing it.. if you have hints as to what may be causing it, please let me know. But with respect to sessions, that is all I needed to know. – net_j Apr 18 '14 at 19:20