I am using rti dds version 6.0.0
How can I delete an instance from persistence services history?
I know if I dispose instance with data writer that published last sample, it will delete from persistence history if it was in keep_history_last. But I want delete last sample from persistence services history after reboot computer, when I create new data writers and data readers
The Persistence Service must receive a Disposed sample for the instance to remove the history of the instance from persistence storage.
So, you pretty much have to call Dispose on a DataWriter for the instance that you want to dispose. So, when you create the new DataWriter, you need to call dispose() with the instance that you are disposing. If that isn't working, you may need to first send a dummy sample with the new DataWriter and then call dispose().
Finally, if there is a reasonable lifespan for a sample, you can use the Lifespan QoS to have Persistence Service automatically remove expired samples.
Yes, that's why I suggest that you have your datawriter app send a "dummy" sample before calling dispose()...so that it will be the datawriter that sent the last sample for the instance. But your way can also work...the issue is if you are using a virtual GUID, your seq no must be > than the last seq no sent using the virtual GUID...or else the sample will be dropped as an old sample.
Thanks for your help.
Oh, something that might work without you having to send a dummy data sample for an instance that a new writer wants to dispose...you can try setting this QoS:
The documentation is here:
https://community.rti.com/static/documentation/connext-dds/7.3.0/doc/api/connext_dds/api_cpp/structDDS__DataWriterProtocolQosPolicy.html#a7d8c1e77cbcf49d4b993d2e567c6468a