Mapdb and previousState

I am trying to move to openHAB 2 and running into an issue getting rid of all my db4o for the move. As an example:

rule "Today Grid Used"
when
  Item Grid_wh changed
then
  logInfo("testing", "MapDB testing........")
  val double previous_meter = Grid_wh.previousState(true, "db4o").state
  val double current_meter = Grid_wh.state
  logInfo("testing", "MapDB testing........" + "Previous: " + previous_meter + " Current: " + current_meter)
  val double today_grid = if(Today_Grid_kWh.state == Uninitialized) 0 else Today_Grid_kWh.state
  postUpdate(Today_Grid_kWh, today_grid + ((current_meter - previous_meter)/1000))
end

Works fine, no issues, however if I just chage db4o to mapdb in:

val double previous_meter = Grid_wh.previousState(true, "db4o").state

It fails. I verified that mapdb is storing the data with DEBUG log:

2017-01-14 19:24:05 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893715.124' in mapdb database
2017-01-14 19:24:21 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893739.115' in mapdb database
2017-01-14 19:24:37 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893765.065' in mapdb database
2017-01-14 19:24:53 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893790.945' in mapdb database
2017-01-14 19:25:09 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893816.633' in mapdb database
2017-01-14 19:25:25 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893842.142' in mapdb database
2017-01-14 19:25:41 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893866.136' in mapdb database
2017-01-14 19:25:57 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893890.191' in mapdb database
2017-01-14 19:26:13 DEBUG o.o.p.m.i.MapDBPersistenceService[:167]- Stored 'Grid_wh' with state '32893914.056' in mapdb database

Any ideas?

Maybe I am missing something but doesn’t mapdb only store one last value so by default cannot provide a previous state?

Right, but if I am using receive update, would not previousState be the state before the update?