lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I've come across a slight problem in dealing with problems when using
LuaSQL.  I have a select statment that, for some reason I haven't yet
managed to figure out, returns the error message below:

> require "luasql.oci8"
> dbenv = luasql.oci8()
> dbcon = dbenv:connect("SERVICE", "USER", "PASSWORD")
> dbcur = dbcon:execute(_select_statement_)
stdin:1: LuaSQL: invalid type 12 #2
stack traceback:
        [C]: in function `execute'
        stdin:1: in main chunk
        [C]: ?
> =dbcur
nil

So far so bad. But now I want to bail out:

> dbcon:close()
stdin:1: LuaSQL: there are open cursors
stack traceback:
        [C]: in function `close'
        stdin:1: in main chunk
        [C]: ?

so now I'm stuck.

And attempting to close the environment tells me about the open
connection.  I haven't looked at the other db types to see if they all
behave the same way.

My gut instinct would be to have close() tear down the other stuff as
well.  So, dbcon:close() would automatically close all open cursors,
and dbenv:close() would close all open connections (which in turn
closes all cursors).

Robby