A few questions
Ian Devaney
idevaney at mac.com
Tue Oct 21 09:06:41 CDT 2003
Thanks Ruslan - that's all a big help.
I'm now getting to grips with the chages re: baseObjects/Cursors.
I have changed all create/update/delete methods to use a cursor - I
presume this is correct.
Just a couple more questions...
As I said, I am currently developing the application using the local
plugin/files etc. with a view to eventually running it as a vServer db.
Are there any other things I should be putting in my code no ready for
the server version.
For example, should I somehow be testing for the connection to the db
each time I access it?
The other thing I am not completely sure about are the parameters used
when creating a cursor.
When I create a cursor using a Select statement, I am doing nothing new:
cursor = mainDb.sqlSelect(s)
But in the update/create methods I am now using I am passing
parameters for locks etc. I don't fully "get" this and was wondering if
these parameters should be different in the server version of the app.
Thanks,
Ian
On Monday, October 20, 2003, at 02:19 pm,
valentina-request at lists.macserve.net wrote:
>
>> I'm just starting my first Valentina project for while and have some
>> questions regarding changes since I Iast used it seriously.
>>
>> Am I right in thinking that I should now user cursors - rather than
>> baseObjects - for updates?
>
> In the past this was true also.
> BaseObject API was always under warn.
>
>> If this is the case, what about creating records?
>
> The same,
>
> Just keep in mind -- Cursor API can work with Vserver.
> BaseObject API cannot. Only with local db.
>
>> Let's say I have some code I use for creating a new record. It uses
>> "setBlank" on the baseObject and then populates it with values before
>> calling "addRecord".
>>
>> In the past, I could use the majority of this code - the bit that
>> populates the table/baseObject - in my update routine. What happens
>> now
>> if I have to use a cursor for the update part?
>
> You still can use BaseObject API,
> But only for local db
>
> To use cursor you do
>
> curs = "SELECT ... FROM T WHERE RecID = 0 "
>
> curs.SetBlank()
>
> set fields:
>
> curs.AddRecord()
>
> Very similar to BaseObject API.
>
>
>> Also, my project is likely to end up running on vServer.
>
> Then no doubts you need switch to cursor API and SQL.
>
>> However, I am doing most of the early development using the regular
>> RB plugin
>> and methods. I know about the differences when creating db's etc. Is
>> this a
>> safe thing to do and are there any other pitfalls I should be aware
>> of when
>> working this way?
>
> IF you use only cursor then to jump to Vserver you need change just
> only
> line with db.Create().
More information about the Valentina
mailing list