Forum: Ruby ruby odbc statement releasing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6d4fb1d8ffd20393799bb80c1cabecb6?d=identicon&s=25 Achilles Schmelzer (aaachilless)
on 2014-03-12 18:41
class MyDatabse < ODBC::Database
  def initialize()
    super
    @driver=ODBC::Driver.new
    @driver.attrs['dsn']='my_dsn'
    self.drvconnect(@driver)
  end
  def get_table(tablename)
    self.run("SELECT * FROM #{tablename}")
  end
  def finalize()
    self.drop_all
  end
end

myDB=MyDatabase.new
table=myDB.get_table('some_table')

-----------------------------------------------

the self.drop_all should be dropping all open statements when myDB is
garbage collected. For some reason, I'm still getting a 'WARNING:
statement XXXXXXX was not dropped before garbage collection.'

Does anyone know why this is happening?
This topic is locked and can not be replied to.