I agree with Lance, but I just want to comment on the overall problem.
Unless the per-step lifetime in your wizard is in the order of a few
seconds, you are, in my opinion, unnecessarily optimizing to reduce
database operations (and if it was in the order a few seconds, a wizard
might not be the right UI flow). Just writing the state of a logical
incomplete operation to the database has lots of benefits, like increased
reliability and trackability. It's likely that only a few percents of your
users are inputting data (i.e. causing write operations) compared to the
number of causing read operations, so any modern database backend is likely
to be able to cope with the load without a hitch.

Just my two cents,
Kalle

On Fri, Oct 24, 2014 at 9:02 AM, Lance Java <lance.j...@googlemail.com>
wrote:

> Instead of null ids, you could give your unsaved entities unique ids that
> are negative. This would require a smart enough ValueEncoder that would NOT
> attempt to lookup negative ids from the database.
>
> It's all sounding a bit hack so you might prefer to pass around a wrapper
> object which knows if the object has been persisted yet or not. Perhaps an
> entity that has been persisted might encode as "P:123" and a new entity not
> yet persisted would encode as "N:123".
>

Reply via email to