> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of marc
> fleury
> Sent: Sunday, July 01, 2001 11:39 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] new Threads.java (cache bug tests) is
> incomplete.
>
>
> Ok finishing the test of the cache, found interesting stuff...
>
> onto your mail
> 1- turn of html
> 2- see below
>
> Don't get annoyed with me, but your new threads test is incomplete:
>
> that's ok, I don't shoot the messenger, I do shoot the implementor
>
>
>
> - You need to also randomize on the bean's primary key.  I say
> this because
> some of the cache bugs I encountered were as a result of one
> thread throwing
> a context back into the InstancePool(via a rollback or remove)
> while another
> thread(i.e. PassivationJob) had a reference to it and was using it.  Also,
> with your test the way it stands, your entity calls will be serialized, so
> you have almost no chance of creating a race condition.
>
> yes, I realize that putting the pools put an order of magnitude of
> complexity on top of something that is already tremendously complex (the
> synchronization of calls).  I have removed the pools (by simply not
> returning objects to them, they are still there from a code standpoint).
>
> I don't understand the second point, what do you mean the calls will be
> serialized? please explain,
>
>

My point was that if you're accessing the same entity with the same primary
key, the threads will be all queued up waiting on eachother.  Only one
thread will be able to run at one time since it would have a transactional
lock and/or method lock.  Thus it doesn't matter if you run your test with
2, 5, 10, 50, 1000 concurrent threads, you will always have the same result.
Plus, you're not testing concurrent access of the cache, since all
executions would happen in order.

I'm glad you got rid of the InstancePool :)

On a separate topic, why does AbstractInstanceCache.get(), have to
unschedulePassivation?  If a bean is not in the cache, why can't you just
allocate a new one?  This seems like another unnecessary complication.

Can't wait to try out the new cache stuff....


Regards,

Bill

PS.  Good luck with INS.  One of my french friends was lucky enough to win
the green card lottery.  Maybe you will too?



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to