> 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.

I disagree it is not stupid.

(a) How do you intend in this multithreaded environment to maintain
declarative transactional contexts?
(b) How do you intend to maintain a quality of service for this
transactional work without building a significant amount of framework
(c) The role played by application containers and J2EE is that of allowing
developers to develop business logic and not writing thread safe re-entrant
code.


> 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.

If you want parallel processing of components and you want this done in a
transactionally aware fashion you should investiagte the use of messaging
systems like JMS and the EJB 2.0 Message Driven Beans which allow you to
create logical threads while maintining declarative transaction contexts and
thus avoidingin the risk in trying to implement your own multi-threaded
re-entrant code.


Dave Wolf
Internet Applications Division
Sybase

>
> 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".
>
>

===========================================================================
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".

Reply via email to