Issue Details (XML | Word | Printable)

Key: PYFB-34
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Pavel Cisar
Reporter: Pavel Cisar
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird driver for Python

Server resources not released on PreparedStatement destruction

Created: 01/May/13 07:59 AM   Updated: 14/May/13 11:31 AM
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.1.1


 Description  « Hide
Releasing the Cursor instance does not permanently free the prepared statement on the server side. During the destructor of the Cursor instance the internal managed PreparedStatement instances will also be released. This will call the method _close from PreparedStatement. Inside the _close Method the release of the server side statement resource will only be triggered if there is an open connection. But to get this connection the PreparedStatement instance uses the cursor Attribute which is a weak reference to the Cursor instance. But this Cursor instance is no longer available because the program execution is inside the destructor (__del__) of this cursor. The weak reference is dead.

It seems that Cursor and PreparedStatement instances are released on the client side but the following statement from the _close method of
PreparedStatement doesn't get executed.

  api.isc_dsql_free_statement(self._isc_status, stmt_handle,
                                              ibase.DSQL_drop)



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 02/May/13 10:53 AM
Fix was not correct. There are problems with PerapedStatement __del__ method that reports bad statement handle for some tests in fbtest.

Pavel Cisar added a comment - 14/May/13 11:31 AM
Reopenned to change fix for version.

Pavel Cisar added a comment - 14/May/13 11:31 AM
Fix version changed.