• Post Reply Bookmark Topic Watch Topic
  • New Topic

question about session and entity beans

 
Robin Zhang
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) can stateful session hold a collection of entity beans' reference? If yes, is it a good design? is there any other way to avoid it?
2) can one entity bean use two table(one table is read only)? is it a good design?
thanks
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Q1
I feel it should be the stateless session bean holding a collection of references (Session facade). Thats the pattern used when you are using more than one entity bean.
Q2.
I feel an entity bean mapped to more than 1 table is better, but there are few if's
1. If more than 1 table forms to be logical
2. If you are using BMP, you can effectively use this, since the joins you write can be optimised.
3. But i guess if you have such kind of application model, you are more or less tying up your data to the presentation.Because if you want to get information from a single table for other purpose then you cant reuse the existing one.So i feel stateless session holding the collection is better than 2nd approach.
Harish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!