Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Object Prevalence for EMF
Object Prevalence for EMF [message #415968] Mon, 14 January 2008 19:36 Go to next message
sensystems is currently offline sensystemsFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Object Prevalence for EMF [message #415975 is a reply to message #415970] Mon, 14 January 2008 22:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Christian W. Damus schrieb:
> 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'm using exactly this strategy to write changes to a database using iBatis.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Object Prevalence for EMF [message #416067 is a reply to message #415975] Wed, 16 January 2008 19:13 Go to previous message
sensystems is currently offline sensystemsFriend
Messages: 24
Registered: July 2009
Junior Member
Thanks Christian and Tom
Ill be looking at this and let you know if i have any trouble.
JhonE

Tom Schindl wrote:
> Christian W. Damus schrieb:
>> 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'm using exactly this strategy to write changes to a database using
> iBatis.
>
> Tom
>
Previous Topic:Having trouble with serialization to XML
Next Topic:problems with headless invocation of Ecore2GenModel
Goto Forum:
  


Current Time: Fri Apr 26 04:29:51 GMT 2024

Powered by FUDForum. Page generated in 0.02680 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top