Home » Modeling » EMF » Object Prevalence for EMF
Object Prevalence for EMF [message #415968] |
Mon, 14 January 2008 19:36 |
sensystems Messages: 24 Registered: July 2009 |
Junior Member |
|
|
Hello, some time ago i found object prevalence as a convenient
persistence alternative for the rcp application im currently developing,
because saving the entire model each time a transaction is made does
not seem efficient, so i´d like to store only the transactions, and use
them to restore system in case of failure.
So, im asking you, what would be the best strategy for serializing the
transactions i made to a model into disk? i mean is any out of the box
or proffered way to do this in the EMF world?
this is a summary of the prevalence approach:
"In a prevalent system, everything is kept in RAM, as though you were
just using a programming language. Serializable command objects manage
all the necessary changes required for persistence
Before changes are applied to business objects, each command is
serialized and written to a log file. Then, each command is executed
immediately. Optionally, in a low-use period, the system can take a
snapshot of the business objects, aggregating all the commands applied
into one large file to save some reloading time.
During system recovery after a shutdown or system crash, the system
retrieves its last saved state from the snapshot file (if one is
available) and then reads the commands from the log files created since
the snapshot was taken. These commands are applied to the business
objects exactly as if they had just come from the system's clients,
including the system clock. Thus, the system returns to the state it was
in just before the shutdown and is ready to run."
see more info at:
http://www.ibm.com/developerworks/library/wa-objprev/
An introduction to object prevalence
and at:
http://www.prevayler.org/wiki/
thanks in advance.
JohnE
|
|
|
Re: Object Prevalence for EMF [message #415970 is a reply to message #415968] |
Mon, 14 January 2008 20:44 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, JohnE,
This sounds very much like the transaction log in relational database
systems.
The only thing similar that I can think of in EMF is the ChangeDescription,
which model is defined in the org.eclipse.emf.ecore.change plug-in. A
ChangeDescription (typically produced automatically by recording, using a
ChangeRecorder) describes the changes required to revert the state of an
EMF model instance to a previous checkpoint.
I can conceive of an application that records ChangeDescriptions, computes
their inverses (because we need to save forward changes, not undo changes)
and saves them to the log. Have a look at the ChangeDescriptionImpl's
applyAndReverse() operation for details of how that all works.
Perhaps Ed has more ideas.
Cheers,
Christian
sensystems wrote:
> Hello, some time ago i found object prevalence as a convenient
> persistence alternative for the rcp application im currently developing,
> because saving the entire model each time a transaction is made does
> not seem efficient, so i´d like to store only the transactions, and use
> them to restore system in case of failure.
>
> So, im asking you, what would be the best strategy for serializing the
> transactions i made to a model into disk? i mean is any out of the box
> or proffered way to do this in the EMF world?
>
> this is a summary of the prevalence approach:
>
> "In a prevalent system, everything is kept in RAM, as though you were
> just using a programming language. Serializable command objects manage
> all the necessary changes required for persistence
>
> Before changes are applied to business objects, each command is
> serialized and written to a log file. Then, each command is executed
> immediately. Optionally, in a low-use period, the system can take a
> snapshot of the business objects, aggregating all the commands applied
> into one large file to save some reloading time.
>
> During system recovery after a shutdown or system crash, the system
> retrieves its last saved state from the snapshot file (if one is
> available) and then reads the commands from the log files created since
> the snapshot was taken. These commands are applied to the business
> objects exactly as if they had just come from the system's clients,
> including the system clock. Thus, the system returns to the state it was
> in just before the shutdown and is ready to run."
>
> see more info at:
>
> http://www.ibm.com/developerworks/library/wa-objprev/
> An introduction to object prevalence
>
> and at:
> http://www.prevayler.org/wiki/
>
> thanks in advance.
> JohnE
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 04:29:51 GMT 2024
Powered by FUDForum. Page generated in 0.02680 seconds
|