1. Helge Tjelta
  2. Valentina Database ADK
  3. Wednesday, July 20 2022, 04:47 PM
  4.  Subscribe via email
Hi, I'm trying to use a RAM based local Database.

I set up the DB, and then uses cursors for adding records...
But if I try to set up another cursors with a sqlselect and using the same table it tells me that the record in that table is locked...

How do I set up the cursor in the first place to not lock for others...
i.e.
cursFolders = mySettingsDb.SqlSelect("Select * FROM Folders", EVCursorLocation.kServerSide, EVLockType.kReadWrite)

when then using this:
curs = mySettingsDB.SqlSelect("Select Navn, TemplateID FROM Folders WHERE TemplateID ='1'", EVCursorLocation.kServerSide, EVLockType.kReadWrite)
I get a message telling me that it is locked...

any ideas ?
Comment
There are no comments made yet.
Helge Tjelta Accepted Answer
And I understand that I have to be very specific, (if using no lock), which cursor that do the updates and which does only read-out of records.

thanks to you all!!!!!
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Helge Tjelta Accepted Answer
Thanks I'll try that. Or use direct API for creating records and use the cursor for using after...

But now I understand that it will lock and stay locked in one method.... the cursor is a property in a global module... so I wanted to contiune to use it... but as you explain here it has to bee freed or use the NoLock...
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Ruslan Zasukhin Accepted Answer
Hi Helge,

This means that the first cursor is alive and keeps its records locked.
The second cursor wants to lock at least one of the same records.

If you want the first cursor not to lock records, then specify EVLockType.kNoLock
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Sergey Pashkov Accepted Answer
Hello Helge,

So you get cursFolders in one method and do some work, method finishes, cursFolders should be freed.
And then later you get another cursor in a different method, and the query fails.
Right?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 4
  • Page :
  • 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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories