Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / March 2004

Tip: Looking for answers? Try searching our database.

How is container threaded?

Thread view: 
dolphinn - 03 Mar 2004 02:48 GMT
From my understanding, each enterpirse bean has a single threaded container
manage it. If two clients request the same enterprise bean at
the same time, then one of them will wait or fail since a single threaded
container can only handle one request at a time. Is this true?
If not, how can we control the multithreading of container?

Thanks,
Jing
Yan Lijun - 06 Mar 2004 06:21 GMT
in my option,
synchronized thread safe is controlled by container,programmer need not care
it,which may be the reason why EJB is so welcome.
also container controls the bean's instance,maybe the container will create
another instance to handle the client's request

在 Wed, 03 Mar 2004 02:48:03 GMT 时, "dolphinn" <jxu2@chat.carleton.ca> 写了:
--

>From my understanding, each enterpirse bean has a single threaded container
>manage it. If two clients request the same enterprise bean at
[quoted text clipped - 4 lines]
>Thanks,
>Jing
dolphinn - 07 Mar 2004 05:07 GMT
But what I am doing is tring to evaluate the performance of J2EE
applications. I wish to simulate the application including platform
infrastructure, so I can learn what factors have impacts on the
performance of softwares based on EJB platform against traditional
java applications.

In the book Mastering Enterprise Java Bean 2nd edition by Ed Roman,
it talks about the relationship between Home Objects, EJB Objects,
and Bean Instances. It says some containers have 1:N relationship
between Home Ojbects and Bean instances and 1:N relationship between
EJB Objects and Bean instances. In which case, there is only one
Home Object and EJB Object istance for a bean, and the home object
and the EJB object are multithreaded.
I am confused here. Isn't that one instance is one thread? How can
one instance of a class be multithreaded?

> in my option,
> synchronized thread safe is controlled by container,programmer need not care
[quoted text clipped - 3 lines]
>
> ?? Wed, 03 Mar 2004 02:48:03 GMT ??, "dolphinn" <jxu2@chat.carleton.ca> ??
??:
> --
>
[quoted text clipped - 6 lines]
> >Thanks,
> >Jing
Christophe Vanfleteren - 07 Mar 2004 09:41 GMT
> But what I am doing is tring to evaluate the performance of J2EE
> applications. I wish to simulate the application including platform
[quoted text clipped - 11 lines]
> I am confused here. Isn't that one instance is one thread? How can
> one instance of a class be multithreaded?

You should read that as "is being accessed/used by several threads at the
same time", hence multithreaded.

Signature

Kind regards,
Christophe Vanfleteren

dolphinn - 08 Mar 2004 02:16 GMT
Thanks for answering. My question now seems to become a fundamental one.
What is the definition of instance and thread in EJB?
Before, I thought that if a class is runable, each instance of this class is
a thread.
One instance is equevalent to one thread.
But now seems a class can have multiple instances, and each instance are
multithreaded.
Then what is the identifier an instance, and what is the identifier of a
thread?

Thanks a lot,
J Xu

> You should read that as "is being accessed/used by several threads at the
> same time", hence multithreaded.
>
> --
> Kind regards,
> Christophe Vanfleteren
John C. Bollinger - 08 Mar 2004 15:12 GMT
> Thanks for answering. My question now seems to become a fundamental one.
> What is the definition of instance and thread in EJB?
[quoted text clipped - 5 lines]
> Then what is the identifier an instance, and what is the identifier of a
> thread?

Objects and threads are almost orthogonal concepts.  Objects (a.k.a.
class instances) are characterized by their state and behaviors.
Threads are independant sequences of execution, which exercise objects'
behaviors and modify of their state.  The number of threads of execution
to which an object is exposed is not generally a characteristic of that
object -- it is a characteristic of the program using that object.

This all gets a bit muddied in Java because of the java.lang.Thread
class.  It helps to understand that a Thread object does not fully
encapsulate a thread -- it is more of a control panel for one.  The
actual thread is a VM-level / OS-level native entity.

Any live object is uniquely identified by the VM that contains it and
its reference in that VM.  Any Java thread is identified by the VM to
which it belongs and the java.lang.Thread instance associated with it.
A thread is not inherently restricted with regard to which objects it
may examine or modify.

Going back to your earlier questions, I think you have chosen too
complicated a problem.  "Evaluat[ing] the performance of J2EE
applications" simply has too many variables: the computing platform and
its configuration, the specific J2EE implementation and its
configuration, the particular application(s) and application
configuration(s).  Don't forget to choose which aspects of J2EE you want
to evaluate (before you say "all", go read the hundreds, if not
thousands, of pages of the various J2EE specifications).  If you build a
native model then how closely do you intend to model the J2EE app?  If
you plan a very accurate model then you are probably going to have to
build your own J2EE implementation, or an equivalent.  If a less
accurate model then what do you realistically expect to learn from it?

Finally, you need to very clearly understand the technologies involved
to have any hope of producing any a valid evaluation of them.  Your
questions in this newsgroup thread make it clear that you do not have a
good grasp of threading, and that is a very fundamental aspect of what
you want to test.  Moreover, it is unlikely that you will gain the
necessary depth of understanding from Usenet.  Given the breadth of the
problem you are trying to tackle, you are not going to be able to learn
enough fast enough to produce any valid answers before the problem
ceases to be relevant.  I recommend that you narrow the scope.

John Bollinger
jobollin@indiana.edu


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.