Speeding up ODBC operations by keeping the connection open

From Planimate Knowledge Base
Jump to: navigation, search

Have implemented an option in ODBC Read to leave the database open after
the operation. This retains the connection to the DSN. If the same DSN
is required again, the cached connection will be used and will be much
quicker than opening a new one.

To keep a particular connection open over multiple change objects, each
change object using that DSN must have the "Keep Open" option on.

Only one DSN can be kept open, a new one will override an older one.

However if a second DSN is accessed while an existing DSN has been cached
AND the KeepOpen option is not on for the second DSN, the original DSN
will remain cached/open.

Future Planimate versions may support caching multiple DSNs.

A modeller should close a DSN (by making the last access to it from a
change object without the KeepOpen() option. Not doing so is not good
practice and a warning will be logged to the Planimate debug file when
the model is closed

idkbase note 40