Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » in memory rollback
in memory rollback [message #384249] Fri, 12 December 2008 08:54 Go to previous message
Tom Eugelink is currently offline Tom Eugelink
Messages: 801
Registered: July 2009
Senior Member
Ok, I know these are complex questions, but I just throw them in the group to see if anyone has a bright idea.

Again this is about the entities that are created/modified/remove based on changes made in other entities (read: stock modifications).

The scenario I'm trying to solve is this:
- An "transfer" entity has two changes; two amounts were altered, that belong to each other (like a transfer between bank accounts).
- Based on amount 1 a stock change "A" is made
- Based on amount 2 another stock change "B" is attempted, however the validation throws an exception because the change is illegal (would cause a negative stock).

The exception correctly is shown and change "B" is not made, however change "A" still exists in memory.
If the user navigates away from the screen, he is notified that change "A" is still pending and is asked to persist it: only a partial transaction is performed!

Now, I can solved this from within a closed situation (with just the two related amounts as described above) by holding off on applying the change until the second one also turns out ok. But this also can happen in multiple amount-pairs. E.g. pair 1,2,3 are ok and pair 4 fails. Basically what I need is in-memory transactions. I need to be able to snapshot a memory state and all changes on entities after that must be rollbacked if an exception occurs.

Now, my business model is fully property-change-event supporting, that means that every property, even collections, fire PCE's. I could record all the PCE's and try to roll them back... But it seems like quite a thing to build.

Any suggestions?

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:mappingworkbench private owned vs. cascadetype ?
Next Topic:Dali JPA Tools 2.1 now available for download
Goto Forum:
  


Current Time: Wed May 22 15:34:22 EDT 2013

Powered by FUDForum. Page generated in 0.01680 seconds