1. Christian Breu
  2. Valentina Server
  3. Суббота, Февраль 10 2018, 09:42 AM
  4.  Подписаться через email
Can you explain the pros and cons about the different cursor location settings?
When to use serverside and when clientside?
Комментарий
There are no comments made yet.
Christian Breu Ответ принят
Hello Rusland

Thank you for clarification – that helps!
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Hi Christian,

1) CLIENT-SIDE

mySQL, postgreSQL - on default have client-side cursors. This means that found N records are copied into RAM of client computer. So you can read these records fast after they arrive to client. You can read them many times. But you can only read.

If you need to modify at least one value in one of that records you should

  • build string of SQL command UPDATE
  • send it to remote db server
  • resolve problem with up-to-date of your cursor -- it now differs from record(s) on server
  • if needed again execute select and replace your records


Speed depends on N and the network speed.

You often can see usage of LIMITs to reduce N.

2) SERVER-SIDE cursors

* brings to the client computer only the first record after SqlSelect(). So if N is huge, it should be a faster reaction.
* server still remembers found N records as Set. So we spend RAM of Server.
* Server also keeps record-locks as you asked in a parameter of SqlSelect() or SqlQuery().

* you can MODIFY records of such cursor, again if you have specified this in the parameter.
So you can do just
curs.Field("Name";).value = "NewValue"
curs.UpdateRecord()

and you get all right. This has modified a remote record, and your cursor now uses that modified value. This do not create any SQL command behind. This is special native commands in Valentina Server protocol.

When you do NextRecord() the next record is loaded from VServer. So this operation can be slower than in client-side cursor.
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories