1. Beatrix Willius
  2. Valentina Database ADK
  3. 金, 12月 11 2020, 11:09 AM
  4.  メールで購読
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.
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
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.
コメント
There are no comments made yet.
Beatrix Willius 承諾済みの回答
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.
コメント
There are no comments made yet.
Beatrix Willius 承諾済みの回答
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?
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
Probably you do something like db.Flush after adding new data?
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
BTW, it must be db_location - not journal!

ValentinaDB.CheckRollback( db_Folderitem )
コメント
There are no comments made yet.
Beatrix Willius 承諾済みの回答
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!
コメント
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