large transaction sizes and rollbacks
John Pearcey <[email protected]>
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <[email protected]> |
I have been using prevayler for a few weeks now on a new project and it
is saving me a lot of time because I don't have to bother with a
separate database or other persistence layer and it is also blindingly
fast. Great stuff so far. I have only one issue and not easy to explain.
Not sure if anyone's got any ideas to help me out here or whether I am
not using it correctly.
I have an update to make to my in-memory model. This update needs to be
applied in full or not at all. The update comes from a single file which
might be say 100MB in size. Each file have a unique date stamp
associated with it. I didn't want to deserialise the whole file into
RAM, pass it to the TransactionWithQuery implementation for it to be
effectively serialised again and then the cloned (or deserialise) copy
to be used in executeAndQuery. I can see myself running out of RAM very
quickly here.
What I have done instead is simply save a date stamp object. To my
understanding, this will be saved in the transaction log. When
executeAndQuery runs, the method uses the date object to locate the
file , deserialise it and apply the data to the memory model. I have
this working correctly with no problems. (It's fast too!). The problem
comes if the file has bad data for example (even though it has been
thoroughly checked, you can never be too sure). executeAndQuery() will
throw an exception but prevayler does not propagate this and it
disappears. I have restored the memory model (effectively a manual
rollback) but the date object is still in the (prevayler) transaction
history which means that, upon restart, prevayler use this date
unnecessarily, since it is bound to fail.
In summary: is there any way to remove a transaction where the
application to the memory model failed? or
is there a way to tell prevayler that the transaction was
effectively rolled back so that on subsequent startups, it is ignored.
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org