Postvayler

hakan eryargi <[email protected]> Mon, 2 Dec 2013 01:12:05 +0200
Newsgroups gmane.comp.java.prevayler
Message-ID <CAPg-4YW2inWf+44VSuMKSpd5Sp6cnA5Ov6s+YJrAv47y99OE+w@mail.gmail.com>
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