Close - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Connection

 Close
 close the Connection Module

 Calling Sequence connection:-Close( )

Parameters

 connection - Connection module

Description

 • Close frees the resources associated with connection. This happens automatically when connection is garbage collected; however, you can call Close to release the resources immediately.
 • Any descendant modules of connection are closed when connection is closed.  (A module is a descendant of a parent module if it is returned by one of the parent module's exports or if it is a descendant of one of the parent module's descendants.)

Examples

 > $\mathrm{driver}≔\mathrm{Database}\left[\mathrm{LoadDriver}\right]\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$

Create a descendant of conn.

 > $\mathrm{res}≔\mathrm{conn}:-\mathrm{ExecuteQuery}\left("SELECT * FROM animals"\right):$

Close conn.

 > $\mathrm{conn}:-\mathrm{Close}\left(\right)$

Try to use conn.

 > $\mathrm{conn}:-\mathrm{ExecuteQuery}\left("SELECT * FROM animals"\right):$

 Error, (in ExecuteQuery) this object has been closed, no further operations are possible

Try using conn's descendant.

 > $\mathrm{res}:-\mathrm{Next}\left(\right)$

 Error, (in ExecuteQuery) this object has been closed, no further operations are possible