Page 1 of 1

cierre de conexion con FWMariadb

PostPosted: Thu Jun 08, 2017 2:15 pm
by jose_murugosa
Me está pasando lo siguiente,

Hago una conexión a una base de datos
creo un rowset y hago el browse
cierro el browse
elimino el rowset con oRs:End()
me desconecto con oCn:Close()
y si vuelvo a intentar hacer el browse del recordset que destruí con la conexión cerrada, en lugar de darme error me abre el recordset.... o sea como que no se destruyó el recordset y si
hago un xbrowse del objeto oCn me aparece como existente....

Re: cierre de conexion con FWMariadb

PostPosted: Fri Jun 09, 2017 1:45 am
by horacio
Me interesa este tema ya que estoy usando la misma tecnología. Realmente no me había percatado.

Saludos

Re: cierre de conexion con FWMariadb

PostPosted: Fri Jun 09, 2017 10:09 am
by nageswaragunupudi
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.

Re: cierre de conexion con FWMariadb

PostPosted: Fri Jun 09, 2017 10:15 am
by jose_murugosa
Thank you very much Mr. Rao.

Now is clear to me how it works :) .