RE: how to remove OBJECT from BasicIdentifyingSystem

"Jon Tirsen" <[email protected]> Sat, 26 Apr 2003 09:30:47 +0200
Newsgroups gmane.comp.java.nanning.devel
Message-ID <001701c30bc5$c2c921d0$6c4a59d5@jon>
I use the new CheckpointPrevayler which writes both the snapshot and the
transaction-logs with the same ObjectOutputStream. ObjectOutputStream
has its own reference-handling built-in so there's nothing I need to
specially handle in Nanning.

Object IDs had a lot of issues:
 - It needed a special garbage-collect to cleanup unused objects from
the table. The garbage-collect was *extremely* slow for very large
systems (although really fast for smaller ones). When we did scalability
testing we noticed that a garbage-collect took 15 minutes while a
snapshot just took a couple of seconds. Also, it didn't seem to work at
all for large systems...
 - Nanning could only detect and handle references if objects with IDs
where passed as direct arguments to a method. So if a method got an
object that did not have an id but referenced an object that had an id
the reference handling of the referenced object did not work. This
forced you to design around this problem and cripple your object model.
 - The "mixing problem" as we started calling it at work because it
happened so often. It's when objects outside Prevayler reference objects
inside Prevayler, which couldn't be handled by the framework. This also
crippled your object model and was really annoying because it showed up
at weird times when writing unit-tests.

All of these problems go away with the new framework. There's actually
only one noticeable problem left. It's when a method creates an object
and returns it (a factory method). These methods can't be marked
transactional because this object will be instantiated at replay-time
and the following transactions on that object will be using the old
object which was instantiated when the factory method was called the
first time. If you just remove transaction from the factory method
everything work just fine.

> -----Original Message-----
> From: Steve Conover [mailto:[email protected]]
> Sent: Friday, April 25, 2003 7:17 PM
> To: [email protected]
> Subject: RE: [Nanning-developer] how to remove OBJECT from
> BasicIdentifyingSystem
> 
> Jon,
> 
> I guess I ahven't kept up well enough - what about Prevayler 2 makes
> the object id requirement go away?
> 
> Regards,
> Steve
> 
> --- Jon Tirsen <[email protected]> wrote:
> > Actually, I've just removed the whole BasicIdentifyingSystem as I'm
> > using a new feature that I wrote for Prevayler 2. Object ids are no
> > longer required for using the Prevayler-persistence-framework. Many
> > applications might need object ids for other purposes but at least
it
> > makes the Prevayler-framework much simpler (actually about half of
> > the
> > code goes away) and there's no problems with memory-leaks.
> >
> > This new feature is in the CVS. We're integrating it with our
> > products
> > at the moment and it seems to be working. But of course it's a bit
> > experimental. It will definitely be stable for the release of
Nanning
> > 0.3.
> >
> > Instead of using explicit remove()-calls it simply uses Javas own
> > garbage collection.
> >
> > Is this okay with you?
> >
> > > -----Original Message-----
> > > From: [email protected]
> > [mailto:nanning-
> > > [email protected]] On Behalf Of yiming wang
> > > Sent: Thursday, April 24, 2003 3:15 AM
> > > To: [email protected]
> > > Subject: [Nanning-developer] how to remove OBJECT from
> > > BasicIdentifyingSystem
> > >
> > > hi all,
> > >
> > > In order to remove one object from
> > > basicIdentifyingSystem, like "ejbRemove". I thought
> > > out the follow solution:
> > > in object interface add this:
> > > /**
> > >  * @transaction
> > >  */
> > > public void remove();
> > >
> > > in object implementation add this:
> > > public void remove() {
> > > }
> > >
> > > in PrevaylerInterceptor.java add this:
> > >  public Object invoke(Invocation invocation) throws
> > > Throwable {
> > >    	// added by [email protected],
> > >        //to support remove     object function
> > > 	if (CurrentPrevayler.isInTransaction()
> > >             &&
> > > CurrentPrevayler.getSystem().hasObjectID(invocation.getProxy()))
> > > {
> > > if
> > > (invocation.getMethod().getName().equalsIgnoreCase("remove"))
> > > {
> > >
> > > 	CurrentPrevayler.getSystem().unregisterObjectID(
> > >
> > > 	invocation.getProxy());
> > > 			}
> > > 		}
> > > ......
> > >
> > > that can be work. is it right? any better solutions?
> > >
> > > thanks!
> > >
> > > wang yiming
> > > 2003.4.24
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > The New Yahoo! Search - Faster. Easier. Bingo
> > > http://search.yahoo.com
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:ThinkGeek
> > > Welcome to geek heaven.
> > > http://thinkgeek.com/sf
> > > _______________________________________________
> > > Nanning-developer mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/nanning-developer
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Nanning-developer mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/nanning-developer



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf