VCursor_Destructor

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Dec 16 03:09:42 CST 2014


Hi Ivan,

The first two are kind of evident, although I tend to believe that these 
become important as a database gets more complicated.

The third point is interesting. Every time I do a query with a cursor, I 
create a new cursor and store this in a variable. Perhaps I might have a 
dozen of small queries with a cursor for each. Does deleting these 
cursors really enhance code accuracy? How? Would I have less bugs in my 
code because I always close the cursors when I don't need them any more?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other 
colour spaces. http://www.color-converter.com

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi

Fill out this survey please
http://livecodebeginner.economy-x-talk.com/survey/

Munten verzamelen op Facebook
https://www.facebook.com/groups/numismatiek.nl/

On 12/15/2014 14:23, Ivan Smahin wrote:
>
> On Dec 15, 2014, at 12:12, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
>
>> Hi,
>>
>> I'm working on a LiveCode app. How important is VCursor_Destructor()? I've noticed that, in an app I'm working on, VCursor_Destructor() wasn't called. I'm fixing this whenever I notice that it isn't called after a cursor is created, but I don't see any difference, whether it is called or not.
>>
>> I assume that closing a connection destroys all cursors and since a connection is closed automatically after 15 minutes, it doesn't matter much anyway, unless you're issuing really large queries. Is this correct?
>>
>> Is memory maintenance really the only reason to destroy a cursor?
>>
>
> Yes, all existing cursors will be freed on connection.close, but there are few reasons (probably not a complete list) to do it as early as you finish using it:
>
> - free internal record-locks in case of server-side cursor;
> - free memory (cursor, it's cached records ...);
> - code-writing accuracy;
>
>


More information about the Valentina mailing list