Re: Custom ClassLoader
Christian Stein <[email protected]> Thu, 9 Jan 2014 22:05:53 +0100
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <CAJi8+g4tqw5xMzMjoLSTOGFwY+Gapr=TLTP5f5Nhmjsev0Kixw@mail.gmail.com> |
On Thu, Oct 17, 2013 at 8:19 AM, Justin T. Sampson <[email protected]>wrote: > Ah, I wondered if the deep copying was the issue. So, yeah, you can turn > off the deep copying, as you've done there. > > On the other hand, it might be nice to keep it turned on for your tests, > to catch serialization problems, references to domain objects in > transactions, etc. In that case you just configure a journal serializer > with your desired class loader. Up to you. > > I don't think any of us are terribly happy with the PrevaylerFactory > design. You may have noticed it's sitting all alone in a separate Maven > module. :) You can always just go straight to the PrevaylerImpl constructor > and bypass PrevaylerFactory altogether, if the reflective access to > PrevaylerFactory's private methods is what's bothering you about your test3 > solution... > > Cheers, > Justin > Hi Justin, coming back to this discussion after while. The PrevaylerImpl solution does not work. It needs a GenericSnapshotManager - the NullSnapshotManager in my case, that combination in turn uses the no-arg constructor from JavaSerializer. So I lived with the reflection code stated above ... so far. But, it didn't feel right! Now I'm using this VolatilePrevayler implementation, that is configurable with a custom class loader and should catch some serialization problems. It served me well so far, all tests are still green. A flaw-by-design is the missing synchronization code, which if fine with my single threaded unit tests. Should be easy to add, if it is needed some day. Do you (or somebody else) see any major issue with this implementation? (I know, it does not prevail ... ehm, persist anything). Cheers, Christian ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&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