Strange database error when closing Livecode on Windows

Bob Sneidar bobs at twft.com
Thu Jul 12 17:04:57 EDT 2012


Oh, interesting that the Mac version of LC doesn't do that! At any rate, I have gotten into the habit of enclosing ALL my database access commands and functions inside a try catch construct. You never know when the plug has been pulled to your database access, at least from a networking perspective. And SQL has I have noticed a habit of disconnecting after a time anyway. 

So I connect, do my thing, then disconnect. This saves me all the hassle later of dealing with the sort of thing you are dealing with now. That won't help you in a memory based sqLite file of course. 

Bob


On Jul 12, 2012, at 1:56 PM, Peter Haworth wrote:

> Maybe.  But it doesn't happen on Macs, only Windows (haven't tried Linux).
> 
> I hope Livecode doesn't do that on any platform since it's quite possible
> that applications will want to do some db housekeeping when they are closed
> and this would prevent them from doing it.
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> 
> 
> 
> On Thu, Jul 12, 2012 at 1:10 PM, Bob Sneidar <bobs at twft.com> wrote:
> 
>> My guess would be that because LC closes all database connections itself
>> when you quit, that LC has already closed the database connection when your
>> script tries to do it again, with a now defunct database id.
>> 
>> Bob
>> 
>> 
>> On Jul 12, 2012, at 12:31 PM, Peter Haworth wrote:
>> 
>>> I have a closeStack handler on card 1 of my main stack that calls
>>> revCloseDatabase passing a global variable in as the database id.  It
>>> checks that the variable is an integer before calling revCloseDatabase
>> just
>>> in case the db wasn't opened.
>>> 
>>> This ll works fine when I close the stack.  However, if I exit Livecode
>> on
>>> Windows with the stack open, I get a runtime error message "revdberr,
>>> invalid connection id" on the revCloseDatabase command.  Thsi only
>> happens
>>> on Windows, not Mac… exactly the same code.
>>> 
>>> I fixed the problem by enclosing the revCloseDatabase in a try/catch
>> block
>>> with no action for the catch but does anyone know why this might be
>>> happening?  Maybe Livecode automatically closes any open databases on
>> exit
>>> on Windows boxes but not on Macs?
>>> 
>>> Pete
>>> lcSQL Software <http://www.lcsql.com>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list