Forum: Ruby ruby odbc statement releasing

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?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.