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

feature: long lived prepared statements #48

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments
Closed

feature: long lived prepared statements #48

GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

According to the docs, prepared statements must be free'd before leaving the 
function, this makes them useful only for statements that will be repeated in 
the same function.

A use case more common to our app is the need to optimize calling a function 
repeatedly so it would be nice to store the prepared statement in a lasting 
scope.

I am trying out the idea of putting the prepared statements in plv8.$prepared 
on init and not calling free.  This goes against the docs so I'm not sure what 
kind of trouble I'm seeking, but is seems to be working thus far.

Thanks

Original issue reported on code.google.com by t...@blit.com on 5 Jan 2013 at 8:40

@GoogleCodeExporter
Copy link
Author

I think it works.  The JS object should not be GC'ed and that object holds the 
pointer to PG's cursor.  So as far as both data is alive, you should be fine.

Original comment by umi.tan...@gmail.com on 8 Jan 2013 at 6:21

@GoogleCodeExporter
Copy link
Author

There is no actionable item on this issue.  Closing.

Original comment by umi.tan...@gmail.com on 9 Apr 2013 at 7:33

  • Changed state: Done

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

1 participant