Connection Object:
oCn:Close() or oCn:End() // functionally same
Closes connection with the server. But remembers all connection parameters.
We can later call oCn:ReConnect() and start working again.
The object itself remains till oCn is set to NIL and all references to the object go out of memory.
RowSet object:
Methods close() / end() do not do anything.
The object remains till oRs is set to NIL.
Even if the connection is closed, if we operate oRs and try to modify data, the connection is ReOpened and work continues. This way even if a connection is interrupted due to loss of internet / physical connection, work can be resumed after restoration of internet / physical connection.
Example:
- Code: Select all Expand view
oCn := maria_Connect( ........ )
oRs := oCn:Customer
XBROWSER oRs FASTEDIT // works
oCn:Close()
oCn := NIL
XBROWSR oRs FASTEDIT // Also works. When we modify data, connection is reopened and work continues
Once rowset is loaded into memory, it does not require connection, unless we try to modify data. When we modify data, it uses the connection if already open and if not reopens the connection and continues to work.