1 - In the EJB specification : you cannot have threads in EJB !!!!
2 - Why ?
Hum, for some purpose, it is stupid, because in some case we want to have
several transactional context and parellel processing in EJB !!!!
But it is not a good practice.
Some (If not all) EJB servers manage their own threads and transactional
context. If you create some thread you will face some problems because
your thread need some synchronisation with EJB server threads !!
3 - What you can do ?
I think that EJB are good for e-commerce, with high transactional context
between client and server, but If you want to manage another transactional
context and access to DB, create a simple JDBC connection, or create
another connection pool ! Or reuse your connection pool to get a new
connection
and work with that.
Take a look at castor.exolab.com which is a JDO (Not compatible with SUN
JSR, but sometimes better).
Hope it help
Christophe
"Sampathkumaran,
Ramkumar (CTS)" To: [EMAIL PROTECTED]
<[EMAIL PROTECTED] cc:
IZANT.COM> Subject: Threading delegate in EJB
Sent by: A mailing
list for
Enterprise
JavaBeans
development
<EJB-INTEREST@java
.sun.com>
02/08/01 08:18 AM
Please respond to
A mailing list for
Enterprise
JavaBeans
development
Hi,
I would like to know whether threading can be done by a normal class in a
EJB server which will be called by a bean.
For eg: I have to retrieve around 2000 rows each from 10 different tables
and aggregate them and send it to the client.
So instead of sequentially accessing each table, can i write a class A
which
implements Runnable and spawns ten threads for acessing each table and
aggregating the values(to be passed to the bean which will pass it to the
client)?
Does this violate the EJB specs or is an acceptable workaround?
Regards,
Ramkumar
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged
information.
If you are not the intended recipient, please contact the sender by reply
e-mail and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding,
printing or copying of this email or any action taken in reliance on this
e-mail is strictly
prohibited and may be unlawful.
Visit us at http://www.cognizant.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".