> I have some stateless beans which access database.
> Can anybody tell me that can i have those beans as session beans
> instead of entity beans.
> What would the good architecture????
A good architecture is (as i see it) to represent the natural entities in
your database(the tables) as entitybeans. Sessionbeans often spans more than
one entitybean and describes more a business concept instead of entities.
E.g. withdrawing of an account, processing an order etc.etc...
You should/could use an entitybean from your client(istead of a session
bean) to modify the entity directly (like a person entity etc.) when it only
affect the actual entity.
The point is if you create a sessionbean for every entitybean, you have a
poor design and a lot of overhead. Therefore its more efficient to directly
talk to an entity in those situations where its natural (when the operation
only affect one entity).
So, when you have a business concept that may span over more than one entity
you will use seesionbeans. Otherwise directly accessing the entitybean would
be ok.
Using stateless og stateful sessionbeans depends on your need of
coversational state between method invocations. Stateless sessionbeans
looses its state after each method call.
\Jon
===========================================================================
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".