[VSDK.framework] mMyTable.GetRecID() problems after SQL query

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Nov 11 17:39:02 CST 2003


on 11/11/03 5:07 PM, Eric Forget at forgete at cafederic.com wrote:

Hi Eric,

>> You make big mistake when mix BaseObject API and Cursor API.
>> This can cause problems if do wrong expectations.
>> 
>> When you do some SQL query or use later Cursor they CAN change current
>> record of Table. You cannot expect that your current record of myTable will
>> be the same after you do SQL on that table because INTERNALY Valentina also
>> use that myTable to build cursors.
> 
> Ok, fine. But why GetRecID() do not returns the right recID? That's why I
> was making the test, to specifically check whether the current record had
> changed...

What means "right RecID" ???

Cursor can move current record of table to ANY position it needs.

If with Table will work ONLY you, and with NO cursor, then yes, current
record will not change.


>> If you want independent current records you need use CURSORS.
>> 
>> Also I wonder on your caching...why then not keep a cursor itself alive as
>> long as you need?
> 
> I do not remember. I know that I have looked at them last winter and find
> missing features. However, I cannot recall which ones.

Well, may be this needed for your task.

> I can rewrite my code to use the cursors. Unfortunately, it means retouching
> about all the code accessing the database... Ouch!

I have warn many times.

    BaseObjects + BitSets => local db, for fast low level access

    cursors               => SQL access and remote access to server.


It is danger mix them.
If you do this you need understand what you do.

Again, if you use BaseObject API you already can't use Vserver.

In some cases developer can use BaseObject API and sometimes mix with cursor
calls for example to get power of JOINS instead of manual coding of that.

-- 
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://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list