Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server resources not released on PreparedStatement destruction [PYFB34] #54

Closed
firebird-automations opened this issue May 1, 2013 · 8 comments

Comments

@firebird-automations
Copy link

Submitted by: @pcisar

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)

Commits: b59ab8f bee6db8 43545f1 FirebirdSQL/fbt-repository@16788b7 FirebirdSQL/fbt-repository@2dc5a90 FirebirdSQL/fbt-repository@1061333

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 1.2 [ 10530 ]

@firebird-automations
Copy link
Author

Commented by: @pcisar

Fix was not correct. There are problems with PerapedStatement __del__ method that reports bad statement handle for some tests in fbtest.

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Resolved [ 5 ] => Reopened [ 4 ]

resolution: Fixed [ 1 ] =>

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Reopened [ 4 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Commented by: @pcisar

Reopenned to change fix for version.

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Closed [ 6 ] => Reopened [ 4 ]

resolution: Fixed [ 1 ] =>

@firebird-automations
Copy link
Author

Commented by: @pcisar

Fix version changed.

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Reopened [ 4 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

Fix Version: 1.1.1 [ 10540 ]

Fix Version: 1.2 [ 10530 ] =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants