File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
aws_advanced_python_wrapper Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ def connect(
178178 def close (self ) -> None :
179179 self ._plugin_manager .execute (self .target_connection , DbApiMethod .CONNECTION_CLOSE ,
180180 lambda : self .target_connection .close ())
181+ self .release_resources ()
181182
182183 def cursor (self , * args : Any , ** kwargs : Any ) -> AwsWrapperCursor :
183184 _cursor = self ._plugin_manager .execute (self .target_connection , DbApiMethod .CONNECTION_CURSOR ,
@@ -222,15 +223,13 @@ def release_resources(self):
222223 def _unwrap (self , unwrap_class : Type [UnwrapType ]) -> Optional [UnwrapType ]:
223224 return self ._plugin_manager ._unwrap (unwrap_class )
224225
225- def __del__ (self ):
226- self .release_resources ()
227-
228226 def __enter__ (self : AwsWrapperConnection ) -> AwsWrapperConnection :
229227 return self
230228
231229 def __exit__ (self , exc_type : Any , exc_val : Any , exc_tb : Any ) -> None :
232230 self ._plugin_manager .execute (self .target_connection , DbApiMethod .CONNECTION_CLOSE ,
233231 lambda : self .target_connection .close (), exc_type , exc_val , exc_tb )
232+ self .release_resources ()
234233
235234
236235class AwsWrapperCursor (Cursor ):
You can’t perform that action at this time.
0 commit comments