I have Worklight HTTP Adapter
, which creates Java Object, this object makes connection with DB, fire specified query and returns result to adapter, which in turn returns the result to mobile application.
The Java Object closes connection of Database
in finalize method, but problem is that finalize method have not been called even after finishing the adapter call.
I have also assigned null to object before returning from adapter.
Hence, I want to know when the Adapter releases Java Object, and when its finalize method will be Called?
JavaDoc says about finalize():
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
So, your finalize method invokes when GC will start.