This project has moved. For the latest updates, please go here.

LastModified (datetime) Property for PersistentDictionary

Mar 6, 2011 at 3:32 AM


BTW, love ManagedESENT, thanks for all the great work!!!

I find myself very often creating an ugly hack to insert a timestamp for the last Modified/Insert time for the database.  To do this I would normally subvert a data field in my stored structure and store the info under a "LastUpdate" key.  This has always seemed like an ugly hack to me and I always wondered if ESENT had a form of last modified date.

If possible it would be VERY useful to have a LastModified property on the PersistentDictionary object.

Thanks and keep up the great work.



Mar 7, 2011 at 4:19 PM

I had considered something like this, but didn't know if anyone would find that useful. A per-row timestamp is easy to do (separatng the information into an insert time and a modified time would be quite cheap).

Keeping an exact last modified time for the database could be more expensive if we tried to keep it exact, because with concurrent updates the threads would serialize on the global timestamp. There are (complex) ways around that, but would an approximate time work? That could be done by keeping a timestamp in memory and flushing it every few seconds.

Mar 7, 2011 at 4:31 PM

An approximation would be fine for my needs, but it would need to persist between sessions.  My main purpose is to determine how out of date (days time frame) some symbol translation data that I am storing in the persistent dictionary is.  I do a periodic batch update from data downloaded over the web.  The process is expensive time wise and updates don't happen terribly often.  I only do the process once the data is X days out of date.

The row level timestamps can certainly be implemented directly in code, but in this case I don't need that.  I would prefer to not have to iterate over the entire data set to figure out what the oldest timestamp is.  I could just create some form of persistent date variable, but I would like to avoid any additional persistence layers if possible.  Your ManagedESENT does great for all my needs.  This would just round off the functionality for me.

I am happy to talk in more detail if it would help.  Once again, thanks for the effort you are putting into this.  It is a VERY useful tool I find myself using more and more often.



Mar 7, 2011 at 4:31 PM
Edited Mar 8, 2011 at 4:16 AM