Disconnect/Reconnect issues

Harold Lee <[email protected]> Sun, 08 Apr 2007 02:07:24 -0700
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>
CLSQL:RECONNECT didn't work for me right off. It looks like 
CLSQL-SYS::CONNECT in sql/database.lisp needs to save the 
connection-spec. At the bottom of the function I changed

      (setf (slot-value result 'state) :open)

to

      (setf (slot-value result 'state) :open
                (slot-value result 'connection-spec) connection-spec)


and all is well...

CL-USER> (setf *conn* (clsql:connect '("hah" nil nil) :database-type :odbc))
#<CLSQL-ODBC:ODBC-DATABASE hah/ OPEN {BA3A171}>
CL-USER> (clsql:disconnect :database *conn*)
T
CL-USER> (slot-value *conn* 'clsql-sys::state)
:CLOSED
CL-USER> (slot-value *conn* 'clsql-sys::connection-spec)
("hah" NIL NIL)
CL-USER> (clsql:reconnect :database *conn*)
#<CLSQL-ODBC:ODBC-DATABASE hah/ OPEN {BAAD719}>
CL-USER>

-Harold