On Saturday, August 17, 2013 7:24:24 PM UTC-7, GregD wrote:

> Jeremy-
>
> Thanks for all the help.  I added to the cspecify for that one test.  But, 
> now I'm having a really really bad thing happening when I run a lot of 
> tests:
>
>      Sequel::DatabaseError:
>        Sequel::SqlAnywhere::SQLAnywhereException: Resource governor for 
> 'prepared statements' exceeded
>
> This means that something is not being closed//cleaned-up properly.   See 
> this in Java if a statement is not closed.  Looking at my code I don't see 
> where I am not closing/freeing and comparing that to the AR code, I think 
> I'm good.  So, I think this is maybe a problem with the ruby sqlanywhere 
> native driver. I updated the gist  
> https://gist.github.com/gditrick/6240781 with the latest.  From the ruby 
> sqlanywhere native driver, it says to do sqlany_free_stmt(rs) on the result 
> set statement.  If you look at my code, I'm doing that after the yield on 
> both my execute and execute_dui.   So, unless Sequel is doing something 
> behind the scenes, it has to be something with the sqlanywhere native 
> driver.  I may have to ping the developer of it, but AR is doing it the in 
> a similar way.
>

You need to put the sqlany_free_stmt(rs) calls in ensure blocks. 
 Otherwise, if there is an exception raised or an early exit 
(return/break/throw), those aren't getting called.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to