Ruby odbc statement releasing

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs