1. Beatrix Willius
  2. Valentina Database ADK
  3. Friday, December 11 2020, 11:09 AM
  4.  Subscribe via email
Got a user where the journal file isn't closed when the database is closed. He sent me a screenshot with multiple databases and multiple journal files. I remember that I had another user with a similar problem.

I had added an lsof. But the result of the shell command is empty.

I also added that the file should be deleted with NSWorkspace. Which is unsuccessful.

Why isn't the journal file deleted? My only idea is now to rm the journal file away.

Xojo 2019r3, Valentina 10.5.3, Crapolina.
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
You mean lsof against journal file while app is running reports that file is not open?
If app is not running - the OS will close file descriptors sooner or later.

Generally, if journal file still exists after db.Close(), then db.Close() was not successful. But it does not mean that journal file existence means some db-health issues, it could be, but not must be.

You can use db.CheckRollback( inLocation as FolderItem ) - before open db to check the state of db's journal file. If true then db will be restored using journal file on db.Open call.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Beatrix Willius Accepted Answer
I'm doing the lsof against the journal file directly after closing the database.

How do I find out if the database was really closed or not? I'll try with the CheckRollback.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Beatrix Willius Accepted Answer
I added some data to my database and did a force-quit during writing so that the journal file is still there. Then I changed the code for opening to


try
if ValentinaDB.CheckRollback(theFolderitem) then
globals.theErrorLog.DialogErrorProceed(Replace(Replace(kJournalCheck, "<<filename>>", theFolderitem.Name), "<<appname>>", app.getMyAppName), kGotIt)
end if
ValentinaDB.Open(theFolderitem)


However, I didn't get the dialog with the existing journal file. Is this okay?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
Ivan Smahin Accepted Answer
Probably you do something like db.Flush after adding new data?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 4
Ivan Smahin Accepted Answer
BTW, it must be db_location - not journal!

ValentinaDB.CheckRollback( db_Folderitem )
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 5
Beatrix Willius Accepted Answer
I was so proud of myself to see that in debug mode I simply nuke the journal file. But debug also has a flush after each write. After changing that I got something in the journal file and not my check went okay.

Thanks!
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 6
  • 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