For Programmers: Free Programming Magazines  


Home > Archive > Prolog > September 2006 > SWI-Prolog : MySQL handle as global variable?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SWI-Prolog : MySQL handle as global variable?
roschler

2006-09-15, 7:00 pm

Would it be a dumb idea to put the handle received from odbc_connect in
a global variable? The idea being to avoid reopening the MySQL
connection from other parts of the program by re-using the handle
stored as a global variable.

Thanks.

Jan Wielemaker

2006-09-15, 7:00 pm

On 2006-09-15, roschler <robert.oschler@gmail.com> wrote:
> Would it be a dumb idea to put the handle received from odbc_connect in
> a global variable? The idea being to avoid reopening the MySQL
> connection from other parts of the program by re-using the handle
> stored as a global variable.


See options alias(Alias), open(once). Using assert/retract is always
a bad idea as the handles may be pointing to non-existing database
connections.

--- Jan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com