RTI Persistence Service Crashes in the middle of transaction

3 posts / 0 new
Last post
Offline
Last seen: 11 months 4 weeks ago
Joined: 08/13/2014
Posts: 55
RTI Persistence Service Crashes in the middle of transaction

Hi

I have written an application which use RTI Persistence Service for saving data in disk. Everything looks fine except when I cut off power from my PC. The next time RTI Persistence Service cannot start and it says that its database is malformed. I have read about this problem in documentations and found this:

Sets the journal mode. This tag can take these values:
DELETE: Deletes the rollback journal at the conclusion of each transaction.
TRUNCATE: Commits transactions by truncating the rollback journal to zero-length instead of deleting it.
PERSIST: Prevents the rollback journal from being deleted at the end of each transaction. Instead, the header of the journal is overwritten with zeros.
MEMORY: Stores the rollback journal in volatile RAM. This saves disk I/O, but at the expense of database safety and integrity.
WAL: Uses a write-ahead log instead of a rollback journal to implement transactions.
OFF: Disables the rollback journal completely. If the persistence service crashes in the middle of a transaction when the OFF journaling mode is set, then the files containing the samples will very likely be corrupted.
Default: DELETE

Can Someone expain more about journal mode and let me know what should I do to prevent this problem? Do I need to create a backup from database and rollback it in case of this problem? Do we have an automatic option for enabling this feature?

Thanks in advance for your helps.

Bonjefir

JavierPovedano's picture
Offline
Last seen: 1 year 9 months ago
Joined: 06/05/2013
Posts: 16

Hi Bonjefir,

To prevent database corruption you should use the appropiate <journal_mode> and <synchronization> settings in your Persistence Service configuration file. All the journal modes and synchronization stragegies supported by RTI Persistence Service are mapped to the journaling modes supported by sqlite. For instance <synchronization>FULL</synchronization>, will provide you more robustness to power failures than NORMAL.

You can find more information about journaling modes and synchronization in: 

Offline
Last seen: 11 months 4 weeks ago
Joined: 08/13/2014
Posts: 55

Dear Javier

Thanks for your explanation. Can you tell me what are the best values for <journal_mode> and <synchronization> settings in your Persistence Service configuration file for preventing database corruption?

Bonjefir