1. Helge Tjelta
  2. Valentina Database ADK
  3. Mittwoch, Juli 20 2022, 04:47 PM
  4.  Abonnieren via E-Mail
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 ?
Kommentar
There are no comments made yet.
Helge Tjelta Akzeptierte Antwort
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!!!!!
Kommentar
There are no comments made yet.
Helge Tjelta Akzeptierte Antwort
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...
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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?
Kommentar
There are no comments made yet.
  • Seite :
  • 1


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