Re: Postvayler

hakan eryargi <[email protected]> Mon, 2 Dec 2013 23:57:20 +0200
Newsgroups gmane.comp.java.prevayler
Message-ID <CAPg-4YVpHViz3hMujuraBFy7=4CCN54bPHDB_20mrQa58ZeEOg@mail.gmail.com>
runtime bytecode injection isnt a current objective. it may be possible
later or not, doesnt really matter in this stage. pre-instrumented classes
is good enough for now, like jibx.

come on, you should have some faith in flying spagetti monster man:)

seriously, if someone sees a flaw, which cant be done, please speak up, so
i wont spend unnecessary hours. to me all seems good for now.

btw, details are constantly changing and evolving. i've shared the project
in a very early stage for discussion

r a f t
On Dec 2, 2013 10:52 PM, "Naveen Chawla" <[email protected]> wrote:

> Hakan, Congratulations for carving out the time to attempt this.
>
> How easy do you think it would be to instrument the object, when it is
> passed in, to simply journal all changes to non-transient fields, and batch
> them into single journal entries when they occur during a synchronized lock
> over the prevalent object?
>
> Can it all be done with run-time instrumentation from start to finish,
> such that no annotations are necessary?
>
>
> On 1 December 2013 23:12, 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
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>
>

------------------------------------------------------------------------------
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