Chainvayler
hakan eryargi <[email protected]> Thu, 23 Apr 2020 08:35:58 +0200
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <CAPg-4YUrLVFj6RS-e0KwPLbThse=HhrS7RuCdXpQVOYfiGtnCw@mail.gmail.com> |
--===============6278658156904687869== Content-Type: multipart/alternative; boundary="000000000000d6312605a3ef76bd" --000000000000d6312605a3ef76bd Content-Type: text/plain; charset="UTF-8" Hey guys, Remember my PoC project *Postvayler* many years ago? It was making POJOs persistent transparently based on @annotations and of course Prevayler. Recently I took the idea one step forward and extended the mechanism to also replicate POJOs among JVMs. Here is my blog post about it: https://medium.com/@hakan.eryargi/transparent-replication-and-persistence-for-pojo-graphs-805d9ae0f776 Here is the project *Chainvayler* itself: https://github.com/raftAtGit/Chainvayler Personally I find the idea really promising :) Cheers, Hakan (r a f t) PS: I'm somehow got out from the email list, re-registered myself. On Mon, Dec 2, 2013 at 12:12 AM hakan eryargi <[email protected]> wrote: > i'm experimenting with the idea. so far not bad. just put what I've done > to GitHub. any suggestions, critics and contributions are welcome:) > https://github.com/raftAtGit/Postvayler > > apologies for the name, it sounded like a nice word play:) > > to run the sample, run the Compiler class > with raft.postvayler.samples.bank.Bank argument and then run > raft.postvayler.samples.bank.Main > > how it works: > compiler injects bytecode to root class and all @Persistent classes that > can be accesible* from root. > > root class contains an injected object pool, where each @Persistent class > is assigned a Long id and put into this object pool when created. this pool > will be* a WeakValueMap so objects which are not attached to root will be > garbage collected at some time. > > each @Persist method in a @Persistent class is instrumented like this: > @Persist > ReturnType doSomething(someParams) {..} > > doSomehing is copied to __postvayler__doSomething(..). the original doSomehing > becomes: > > ReturnType doSomething(someParams) { > if (!there is postvayler context) > return __postvayler__doSomething(..); > if (we are in a prevayler transaction) > return __postvayler__doSomething(..); > return prevayler.execute(new MethodTransaction(..)); > } > > the arguments to doSomehing(..) is transformed in MethodTransaction such > that references to @Persistent objects are replaced with Reference's, > which will later be restored from object pool. seems as this also solves > the Baptism problem. > > looks good to me for now:) > > cheers, > *r a f t* > > * not implemented yet > > On Wed, Nov 27, 2013 at 11:07 AM, Naveen Chawla <[email protected]> > wrote: > >> Sure, here: >> http://docs.oracle.com/javase/tutorial/java/generics/methods.html >> >> As for consistency, any multi-changes explicitly synchronized over >> prevalentObject can be auto-batched. >> >> >> On 27 November 2013 00:25, Klaus Wuestefeld <[email protected]> wrote: >> >>> > It is ordinary generic method syntax. >>> >>> Could you point me to some doc on this syntax? I couldnt find it here: >>> http://docs.oracle.com/javase/tutorial/extra/generics/methods.html >>> >>> > The beginning and end of a transaction would simply be any change to >>> any >>> > non-transient field. >>> >>> Suppose a transaction needs to update two fields to be correct but the >>> system crashes after the first. Will the system not be inconsistent on >>> recovery? >>> >>> Klaus >>> >>> >>> ------------------------------------------------------------------------------ >>> Rapidly troubleshoot problems before they affect your business. Most IT >>> organizations don't have a clear picture of how application performance >>> affects their revenue. With AppDynamics, you get 100% visibility into >>> your >>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of >>> AppDynamics Pro! >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> To unsubscribe go to the end of this page: >>> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion >>> _______________________________________________ >>> "Databases in Memoriam" -- http://www.prevayler.org >>> >> >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk >> _______________________________________________ >> To unsubscribe go to the end of this page: >> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion >> _______________________________________________ >> "Databases in Memoriam" -- http://www.prevayler.org >> >> > --000000000000d6312605a3ef76bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div>Hey guys,</div><div><br></div><div>R= emember my PoC project <b>Postvayler</b> many years=C2=A0ago? It was making= POJOs persistent transparently based on=C2=A0@annotations and of course Pr= evayler.</div><div><br></div><div>Recently I took the idea one step forward= and extended the mechanism to also replicate POJOs among JVMs.</div><div><= br></div><div>Here is my blog post about it:</div><div><a href=3D"https://m= edium.com/@hakan.eryargi/transparent-replication-and-persistence-for-pojo-g= raphs-805d9ae0f776">https://medium.com/@hakan.eryargi/transparent-replicati= on-and-persistence-for-pojo-graphs-805d9ae0f776</a>=C2=A0</div><div><br></d= iv><div>Here is the project <b>Chainvayler</b> itself:=C2=A0<br></div><div>= <a href=3D"https://github.com/raftAtGit/Chainvayler" target=3D"_blank">http= s://github.com/raftAtGit/Chainvayler</a>=C2=A0</div><div><br></div><div>Per= sonally I find the idea really promising :)</div><div><br></div><div>Cheers= ,</div><div>Hakan (r a f t)=C2=A0</div><div><br></div><div>PS: I'm some= how got out from the email list, re-registered myself.</div></div><br><div = class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Dec 2, = 2013 at 12:12 AM hakan eryargi <<a href=3D"mailto:[email protected]= m">[email protected]</a>> wrote:<br></div><blockquote class=3D"gma= il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2= 04,204);padding-left:1ex"><div dir=3D"ltr">i'm experimenting with the i= dea. so far not bad. just put what I've done to GitHub. any suggestions= , critics and contributions are welcome:)<div><a href=3D"https://github.com= /raftAtGit/Postvayler" target=3D"_blank">https://github.com/raftAtGit/Postv= ayler</a></div> <div><br></div><div>apologies for the name, it=C2=A0sounded like a nice wor= d play:)<br></div><div><br></div><div><div>to run the sample, run the Compi= ler class with=C2=A0raft.postvayler.samples.bank.Bank argument and then run= raft.postvayler.samples.bank.Main</div> <div><br></div><div>how it works:</div><div>compiler injects bytecode to ro= ot class and all @Persistent=C2=A0classes that can be accesible* from root.= =C2=A0</div><div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_e= xtra">root class contains an injected object pool, where each @Persistent c= lass is assigned a Long id and put into this object pool when created. this= pool will be* a WeakValueMap so objects which are not attached to root wil= l be garbage collected at some time.</div> <div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">each @Persi= st method in a=C2=A0@Persistent class is instrumented like this:</div><div = class=3D"gmail_extra"><font face=3D"courier new, monospace">@Persist</font>= </div><div class=3D"gmail_extra"> <font face=3D"courier new, monospace">ReturnType doSomething(someParams) {.= .}</font></div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_ext= ra"><font face=3D"courier new, monospace">doSomehing </font>is copied to <f= ont face=3D"courier new, monospace">__postvayler__doSomething(..)</font>. t= he original <font face=3D"courier new, monospace">doSomehing </font>becomes= :<br> </div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><font= face=3D"courier new, monospace">ReturnType=C2=A0doSomething(someParams) {<= /font></div><div class=3D"gmail_extra"><font face=3D"courier new, monospace= ">=C2=A0 =C2=A0 if (!there is postvayler context)=C2=A0</font></div> <div class=3D"gmail_extra"><font face=3D"courier new, monospace">=C2=A0 =C2= =A0 =C2=A0 =C2=A0 return __postvayler__doSomething(..);</font></div><div cl= ass=3D"gmail_extra"><font face=3D"courier new, monospace">=C2=A0 =C2=A0 if = (we are in a prevayler transaction)=C2=A0</font></div> <div class=3D"gmail_extra"><font face=3D"courier new, monospace">=C2=A0 =C2= =A0 =C2=A0 =C2=A0 return __postvayler__doSomething(..);</font></div><div cl= ass=3D"gmail_extra"><font face=3D"courier new, monospace">=C2=A0 =C2=A0 ret= urn prevayler.execute(new MethodTransaction(..));</font></div> <div class=3D"gmail_extra"><font face=3D"courier new, monospace">}<br></fon= t></div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">the= arguments to doSomehing(..) is transformed in <font face=3D"courier new, m= onospace">MethodTransaction </font>such that references to @Persistent obje= cts are replaced with <font face=3D"courier new, monospace">Reference'<= /font><font face=3D"arial, helvetica, sans-serif">s</font>, which will late= r be restored from object pool. seems as this also solves the Baptism probl= em.=C2=A0</div> <div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">looks good = to me for now:)</div><div class=3D"gmail_extra"><br></div><div class=3D"gma= il_extra">cheers,</div><div class=3D"gmail_extra"><i>r a f t</i></div><div = class=3D"gmail_extra"> <br></div><div class=3D"gmail_extra">* not implemented yet</div><div class= =3D"gmail_extra"><br><div class=3D"gmail_quote">On Wed, Nov 27, 2013 at 11:= 07 AM, Naveen Chawla <span dir=3D"ltr"><<a href=3D"mailto:naveen.chwl@gm= ail.com" target=3D"_blank">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Sure, he= re:=C2=A0<a href=3D"http://docs.oracle.com/javase/tutorial/java/generics/me= thods.html" target=3D"_blank">http://docs.oracle.com/javase/tutorial/java/g= enerics/methods.html</a><div> <br></div><div>As for consistency, any multi-changes explicitly synchronize= d over prevalentObject can be auto-batched.</div> </div><div><div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quot= e">On 27 November 2013 00:25, Klaus Wuestefeld <span dir=3D"ltr"><<a hre= f=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>></span>= wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left:1px solid rgb(204,204,204);padding-left:1ex"> <div>> It is ordinary generic method syntax.<br> <br> </div>Could you point me to some doc on this syntax? I couldnt find it here= :<br> <a href=3D"http://docs.oracle.com/javase/tutorial/extra/generics/methods.ht= ml" target=3D"_blank">http://docs.oracle.com/javase/tutorial/extra/generics= /methods.html</a><br> <div><br> > The beginning and end of a transaction would simply be any change to a= ny<br> > non-transient field.<br> <br> </div>Suppose a transaction needs to update two fields to be correct but th= e<br> system crashes after the first. Will the system not be inconsistent on<br> recovery?<br> <div><div><br> Klaus<br> <br> ---------------------------------------------------------------------------= ---<br> Rapidly troubleshoot problems before they affect your business. Most IT<br> organizations don't have a clear picture of how application performance= <br> affects their revenue. With AppDynamics, you get 100% visibility into your<= br> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynami= cs Pro!<br> <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D84349351&iu= =3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net/gam= pad/clk?id=3D84349351&iu=3D/4140/ostg.clktrk</a><br> _______________________________________________<br> To unsubscribe go to the end of this page: <a href=3D"http://lists.sourcefo= rge.net/lists/listinfo/prevayler-discussion" target=3D"_blank">http://lists= .sourceforge.net/lists/listinfo/prevayler-discussion</a><br> _______________________________________________<br> "Databases in Memoriam" -- <a href=3D"http://www.prevayler.org" t= arget=3D"_blank">http://www.prevayler.org</a><br> </div></div></blockquote></div><br></div> </div></div><br>-----------------------------------------------------------= -------------------<br> Rapidly troubleshoot problems before they affect your business. Most IT<br> organizations don't have a clear picture of how application performance= <br> affects their revenue. With AppDynamics, you get 100% visibility into your<= br> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynami= cs Pro!<br> <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D84349351&iu= =3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net/gam= pad/clk?id=3D84349351&iu=3D/4140/ostg.clktrk</a><br>___________________= ____________________________<br> To unsubscribe go to the end of this page: <a href=3D"http://lists.sourcefo= rge.net/lists/listinfo/prevayler-discussion" target=3D"_blank">http://lists= .sourceforge.net/lists/listinfo/prevayler-discussion</a><br> _______________________________________________<br> "Databases in Memoriam" -- <a href=3D"http://www.prevayler.org" t= arget=3D"_blank">http://www.prevayler.org</a><br> <br></blockquote></div><br></div></div></div></div> </blockquote></div></div> --000000000000d6312605a3ef76bd-- --===============6278658156904687869== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6278658156904687869== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion _______________________________________________ "Databases in Memoriam" -- http://www.prevayler.org --===============6278658156904687869==--