Fwd: [V4MD] Commit cursor changes to DB
mo
mo.ritz at gmx.de
Thu Oct 28 14:57:26 CDT 2004
Hi,
I found a solution for my problem. By isolating the script from the
larger application background, I discovered that the problem was not
the update itself, but a subsequent new creation of a server side
read-only cursor to read out the modified table. What I did was a
desperate guess: I created the second cursor with the same properties
as the first one (readAndWrite, server, randomAccess), and voila it
worked.
Looks like a bug of the Xtra to me - is this a known issue?
Cheers!
mo
. .
Moritz Stefaner
0179 - 525 21 26
http://der-mo.net
. .
On 27.10.2004, at 12:56, Ruslan Zasukhin wrote:
> On 10/27/04 12:01 PM, "mo" <mo.ritz at gmx.de> wrote:
>
>> Hi,
>>
>>> Why you use UpdateAll() ?
>>>
>>> As far as I see you SELECT exactly one record,
>>> Because you do WHERE RecID="+RecID
>>>
>>> So you should use just curs.updateRecord()
>>
>> I also tried it with curs.updateRecord(), the problem remains...
>> hmmm...
>>
>> further ideas?
>
> I'd say that problem with record locks, but you say you have set
> ReadWrite.
>
> What cursor you use? ServerSide or ClientSide ?
> ClientSide always is READ ONLY.
> Check this point
>
>
>> Cheers!
>> mo
>>
>>
>> . .
>>
>> Moritz Stefaner
>> 0179 - 525 21 26
>> http://der-mo.net
>>
>> . .
>> On 27.10.2004, at 08:23, Ruslan Zasukhin wrote:
>>
>>> On 10/26/04 11:15 PM, "mo" <mo.ritz at gmx.de> wrote:
>>>
>>>> Hi,
>>>>
>>>> update on this: I was so stupid and forgot to create the cursor with
>>>> the additional flag to set it to read and write.
>>>>
>>>> Now it works... partially ;) The next problem I encounter is that
>>>> when
>>>> I call the saveConfiguration function for the second time, it won't
>>>> work. If I trace the cursor after the update, I see the changes. If
>>>> I
>>>> reselect the same query after that, all field values are aas they
>>>> used
>>>> to be before the update.
>>>>
>>>> Any Ideas?
>>>>
>>>> Valentina gives no error message, btw., neither when creating the
>>>> cursor nor when updating.
>>>>
>>>> It would be great if someone could help me out here..
>>>
>>> Why you use UpdateAll() ?
>>>
>>> As far as I see you SELECT exactly one record,
>>> Because you do WHERE RecID="+RecID
>>>
>>> So you should use just curs.updateRecord()
>>>
>>>> Cheers!
>>>> mo
>>>>
>>>> . .
>>>>
>>>> Moritz Stefaner
>>>> 0179 - 525 21 26
>>>> http://der-mo.net
>>>>
>>>> . .
>>>> On 26.10.2004, at 17:10, mo wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I recently started to sort out Valentina & Diretcor, so this is a
>>>>> very basic question. What is the general modus operandi to store
>>>>> cursor changes in the actual db? What I do right now is:
>>>>>
>>>>> saveConfiguration = function(o){
>>>>> var RecID=o.RecID; delete o.RecID;
>>>>> trace("Model.saveConfiguration ");
>>>>> var c= _global.gDBManager.getDBCursor( "SELECT * FROM
>>>>> configurations
>>>>> WHERE RecID="+RecID);
>>>>> var r=c.updateAllRecords(o.toPList());
>>>>> _global.gDBManager.DBInstance.flush();
>>>>> }
>>>>>
>>>>> but the data is not stored in the database. If I trace the cursor
>>>>> after the updateAllRecords command, the values are changed, however
>>>>> only in the cursor as it seems.
>>>>>
>>>>> Could someone be so kind and shed some light on this?
>>>>> Much appreciated,
>
>
> --
> 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
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
More information about the Valentina
mailing list