Re: CLOSE and FREE
Posted in 1995
Sorry to have to disagree so visibly, but some of this is wrong. }From: beta@cix.compulink.co.uk ("Beta Computers") }Subject: Re: CLOSE and FREE }Date: Thu, 12 Jan 1995 18:35:39 GMT }X-Informix-List-Id: <news.10733> }I think that }Close will } } release any locks Only if the database doesn't have transactions. Only COMMIT (or ROLLBACK) releases locks if the database has transactions. How many locks there are will depend on the isolation level, of course, but with no transactions, you are running at approximately DIRTY READ, so there won't be many locks at all. } flush any buffers in the case of input cursors Correct. } call a commit if transactions began Absolutely NOT -- on COMMIT WORK does that! } release cursor file handles Possibly, but not a major concern. Also depends on SE versus OnLine, and on whether the underlying C-ISAM implementation does pseudo-closes, etc. }Free will } } free up memory used by the cusor Correct. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> --------------------------------------------------------------------------- PS: A colleague of mine pointed out that my original posting was a little imprecise in its wording. }>Date: Fri Jan 13 02:02:24 1995 }>From: oliver@infix.de (Oliver Okrongli) }>To: johnl@informix.com (Jonathan Leffler) }>Subject: Re: CLOSE and FREE }> }>Dear Jonathan, }> }>in c.d.i you wrote: }> }>> So, CLOSE indicates that the cursor is not needed for the time being. }>> However, the Engine retains the query plan for the cursor so that it }>> can be reused. }> }>If the cursor was opened on a prepared select statement, I agree. }> }>If you open a statically declared cursor, our experience (engine versions }>4 and 5) suggests that the engine does release its query plan on CLOSE. }>Re-OPENing the cursor repeats the (time consuming) process of preparing a }>query plan. }> }>Did anything change in the meantime? }From johnl Fri Jan 13 08:36:48 1995 }To: oliver@infix.de }Subject: Re: CLOSE and FREE } }I was speaking in general terms, not with the pedantic accuracy which }perhaps I should have used. To be more precise, the CLOSE may indeed }release the query plan itself, and re-opening a parameterised cursor may }(or may not) cause it to be re-optimised anyway, but the cursor statement }is certainly retained -- it does not need to be re-declared just because }it was closed. } }So, No, nothing changed. I was just a bit lackadaisical in writing my }response.