I've got some Entity bean questions, the answers to which I realize may be
vendor-dependent, but maybe the spec says something I've missed.
1. If two clients both use primary key to find an Entity bean, how does the
container know that there is already a bean in existence for the second caller,
especially if the second caller sues a different primary key that resolves to
the same row from a relational table or object from an OODBMS?
2. You apparently can code find methods that return groups of primary keys,
like an Enumeration. Does this mean that the container will create a set of
entity beans and return keys or handles for all those beans? I'm asking about
his because I thought that a single entity bean mapped to a single row, so this
kind of finder method is quite different from findByPrimaryKey. I realize there
are times you might want to get back multiple rows/multiple beans, so I assume
this is the way to do that, but I wanted to check.
3. Given the overhead of creating entity beans, if you needed to do a select
with a potentially large result, can you simply have a session bean do a query
and get back a normal result set without using entity beans at all? I assume
that's the case, but I wanted to verify it.
4. Transactions, commit and entity beans.
Here's an example scenario: I have an entity bean that represents, let's
say, an airline reservation. SO the caller invokes:
setPassengerName()
setSeatAssignment()
setBadAirlineFOodPreference() (there may be e an airline with good food, but
United, SUn's primary airline, isn't it).
swtFrequentFlyerNumber()
Each of those is a method. As I understand it the container is required to
start a transaction when any of the methods of an entity bean is called and
complete that transaction when the method ends (logically enclose the method in
a begin()...commit() wrapper so to speak). In that case, the container is doing
an awful lot of database calls, because it must do a commit for every little
change to the data in the bean. If this isn't what happens, how does the
container decide when to do a commit, since there's no method, so far as I know,
to say to the bean, "I'm all done so you can commit now)" How does the
container decide this?
4. How can I make the data a bean represents read-only? Do I have to go to
the database engine itself and make the table read-only? Thanks.
Ken
===========================================================================
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".