Well, this may look stupid, but here is.

I do:

number = store.find(Broker).max(Broker.number)

I get the number. But if another db connection adds a new row to DB,
and the code is run again:

number = store.find(Broker).max(Broker.number)

I get the SAME number instead of the new one was just added, because
storm's cache was not updated (I think).

There at least two solutions:

First:
store.commit()
number = store.find(Op).max(Op.number)
This is very dangerous because if there's any pending transaction it
will be committed to DB, so I can't use this.

Second:
store.rollback()
number = store.find(Op).max(Op.number)
This one is also dangerous, because if there's any pending transcation
waiting to be commited it will go away.

invalidate() and flush() does not work. And I think reset() is not recommended.

So, is there any other way to refresh store.find( )?

-- 
storm mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/storm

Reply via email to