{"issue":{"created_at":"2011-10-20T18:48:25Z","state":"closed","updated_at":"2011-12-13T01:55:51Z","comments":9,"user":{"gravatar_id":"3f2a54618bc29921555ec520de338b12","id":1124276,"url":"https://api.github.com/users/bsanders1979","avatar_url":"https://secure.gravatar.com/avatar/3f2a54618bc29921555ec520de338b12?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bsanders1979"},"body":"In my script, I'm caching the results of Database.execute. Script runs, then craps out because of the above message. If I try calling Result.finish, I get this error:\r\n\r\n/usr/local/lib/ruby/gems/1.9.1/gems/rdbi-driver-mysql-0.9.2/lib/rdbi/driver/mysql.rb:329:in free_result': Mysql::Stmt object is already closed (Mysql::Error)\r\nfrom /usr/local/lib/ruby/gems/1.9.1/gems/rdbi-driver-mysql-0.9.2/lib/rdbi/driver/mysql.rb:329:infinish'\r\nfrom /usr/local/lib/ruby/gems/1.9.1/gems/rdbi-0.9.1/lib/rdbi/result.rb:279:in `finish'\r\n\r\nPerhaps I'm doing something wrong? Suggestions? Thanks!","assignee":null,"id":2008001,"labels":[],"number":5,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Can't create more than max_prepared_stmt_count statements","closed_at":"2011-10-28T23:52:02Z","html_url":"https://github.com/RDBI/rdbi-driver-mysql/issues/5","url":"https://api.github.com/repos/RDBI/rdbi-driver-mysql/issues/5","milestone":null},"action":"created","comment":{"created_at":"2011-12-13T01:55:51Z","updated_at":"2011-12-13T01:55:51Z","user":{"gravatar_id":"3f2a54618bc29921555ec520de338b12","id":1124276,"url":"https://api.github.com/users/bsanders1979","avatar_url":"https://secure.gravatar.com/avatar/3f2a54618bc29921555ec520de338b12?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"bsanders1979"},"body":"I have to disagree with the statement that RDBI is broken. To be honest, Ruby DBI is severely handicapped and this link explains why: http://rubyforge.org/forum/forum.php?forum_id=958&style=nested. Basically, if you try to store the result of a query (as opposed to immediately iterating thru it) what you actually get is N rows of rows[-1]. Each element is a distinct object, but they all obviously point to a common object on the heap. The issue is not going to be fixed either, so my only option was to dump it and look for another solution. I discovered RDBI and was instantly hooked. The transition was super easy as I abstracted most of the logic and only had to change a few functions. In short, I developed an engine to archive record trees from one database to another. To do that, I implemented query caching so that I don't have to send the same query to the database to get the same result. I must say that RDBI is actually a well-designed piece of work, but there is definitely room for improvement. After all, it's not even 1.0 yet. I am an end-user just like you are, but I'm telling you about my experience with the library. As for the date issue, you might need to dig thru the code to see what's going on. You might take a look at manipulate_type_maps and see if that has anything to do with it. I had to modify my version to return nil when rescuing an ArgumentError which indicates that the value is not parseable (for the all-zero datetime issue). I did try: DateTime.parse(\"2006-02-09 18:07:27 -0500\") in irb and it worked without issue, so it's hard to say what exactly your problem is. One last thing, if you'd like, I could send you a script template I designed to help get you started with RDBI.","id":3117601,"url":"https://api.github.com/repos/RDBI/rdbi-driver-mysql/issues/comments/3117601"}}