1. Roger
  2. Valentina Database ADK
  3. Wednesday, August 12 2020, 06:38 PM
  4.  Subscribe via email
Hello

I use serversidecursor in readwrite mode, then the record is locked in the table so far all works ok.

But then I use other function (like a report) but the cursor is with all i tried not really unlocked. What is the best/correct way to unlock a record or a table? (Read first or next not helps, read all with kNoLocks not helps too)

Regards Roger
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
What exactly do you mean by
I use other function (like a report)
?
kNoLocks is not locking the records at all. Also you may try clientSide cursor to avoid locking.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Roger Accepted Answer
Before this coe in an other function I read an Adresse in readwrite mode, then its modified or not. The adresse at end I need to work more with it. - And this is my problem - In the last read in this code the Adresse is every time locked and I cannot see what is the problem.

To know - I have similar functions, the other functions the sql string contains pointers to an second table and this works all fine. The only difference is I read here only one table....


RecID = AdresseCursor.Field("RecID").Value

AdresseCursor = Nil

AdresseCursor = db.SqlSelect("SELECT ** FROM Adresse", _
EVCursorLocation.kServerSide, EVLockType.kNoLocks)

Projektname = GetFolderItem("solution.vsp")
ProjektValentina = new VProject(Connection, Projektname)
ProjektValentina.Open()

CommmandString = "SELECT * FROM Adresse "_
+ "WHERE Nachname > '' AND Adresstyp = '" + MainWindow.AdresstypPopupMenu.SelectedRowValue + "' "_
+ "ORDER BY Nachname ASC, Vorname ASC"

ReportValentina = ProjektValentina.MakeNewReport("Telefonliste", db, CommmandString)

Pfad = SpecialFolder.Documents.Child("x").Child("Telefonliste.pdf")
ReportValentina.PrintToDisk(Pfad, EVReportPrintType.kToPDF, 1 )

Pfad.Open

AdresseCursor = Nil

Statement = db.Prepare("SELECT ** FROM Adresse WHERE RecID = :1")
Statement.BindUInt32(0, RecID)

AdresseCursor = Statement.SqlSelect(EVCursorLocation.kServerSide, EVLockType.kReadWrite)

Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Ivan Smahin Accepted Answer
Please try following:


ReportValentina = ProjektValentina.MakeNewReport("Telefonliste", db, CommmandString, ECursorLocation.kClient, ELockType.kNoLocks )
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Roger Accepted Answer
Manhy thaks Ivan, now it works. :D
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