[SQL] Client and server cursors

Ramin Firoozye ramin at wizen.com
Tue Mar 4 13:56:14 CST 2003


Hi Ruslan,

Two suggestions for the Update() call:

- A 'bool' (default to false) indicating that a server-side 'Flush' should
also be done to make sure it gets written all the way to disk back at the
server.

- An optional 'time-out' value. Just in case the communication link dies or
things get hung-up (in fact, for anything involving network communication, I
would suggest the option of a timeout or an asynch capability with a
callback handler).

Just some thoughts.
Ramin

> -----Original Message-----
> From: valentina-bounces at lists.macserve.net
> [mailto:valentina-bounces at lists.macserve.net]On Behalf Of Ruslan
> Zasukhin
> Sent: Tuesday, March 04, 2003 1:09 PM
> To: valentina at lists.macserve.net
> Subject: [SQL] Client and server cursors
>
>
> Hi guys,
>
> Just want discuss a little issue of cursors for Valentina Client.
>
> As some of you know mySQL and Postgre, have client-side and server-side
> cursors.
>
> When e.g. MySQL create client-side cursor this means that found N records
> are transferred to client into its RAM, and there is no more overhead on
> Server side.
>
> Now you can ONLY read records of this cursor.
>
> IF you want change or add or delete some record of this cursor, you need
> send to server OTHER SQL command as
>         "INSERT ... " or
>         "UPDATE .. WHERE ID = N"
>         "DELETE .. WHERE ID = N"
>
> -----
> What we try now implement for Valentina is ability to use the SAME cursor
> API, that we use for local dbs.
>
> So this looks as
>
>     curs = db.SqlSelect( "SELECT ...", ReadWrite, kClient )
>
> Now if you want do modifications of records you can do simply:
>
>     curs.Stringfield( "name" ) = 'something new'
>     curs.Update();  <<<<<<<< this send command to server.
>
> €€>> What you think about this approach ?
> €€>> Anybody see any potential problems with this ?
> **>> I do not remember if any other db use this way? IT seems I have see
> always generation of new SQL command in background...
>
> -----
> As for me I think this is really MORE EASY and more comfortable way,
> Then generate new SQL string for command.
>
> And this looks to be more effective, because again,
> -- you do not spend time and resources to build SQL string
> -- server do not spend time to parse it.
>
> Data simply go by special protocol in binary form from client to server.
>
>
> --
> Best regards,
> Ruslan Zasukhin      [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan at paradigmasoft.com
> web: http://www.paradigmasoft.com
>
> To subscribe to the Valentina mail list go to:
> http://listserv.macserve.net/mailman/listinfo/valentina
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list