1. Helge Tjelta
  2. Valentina Database ADK
  3. 水, 7月 20 2022, 04:47 PM
  4.  メールで購読
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 ?
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
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?
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
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
コメント
There are no comments made yet.
Helge Tjelta 承諾済みの回答
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...
コメント
There are no comments made yet.
Helge Tjelta 承諾済みの回答
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!!!!!
コメント
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. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories