Hi Gene,

Thanks so much for the explanation! I'm really overwhelmed by how helpful
everyone is on this list. I hope that when I'm an EJB expert I can give back
as much good help as I'm getting now....

> The best EJB architecture involves user accessing
> only CMT Session Beans, which in turn manipulates Entity beans.  Let the
> methods of the SessionBean manage the txns for the entity beans it evoke;
> plus you won't have to interlace your business logic with ugly
> UserTransaction codes.

Does this mean that if I call a bunch of someEntityBean.set() methods from
within someSessionBean.whatever() method, and one of those set() methods
throws an EJBException, then all the values that were just set will be
rolled back?  In other words, the new values won't make it to the database,
so by extension the next time a client calls someEntityBean.get(), the
client will recieve the original value, not the value I just tried to set?


> From within a txn, the ejbLoad of a particular entity bean will be called
> only once:  at the beginning.  Usually, ejbStore is also called once, at
the
> end;  however, certain servers allow you to set a flag that causing db
> flushing to occur throughout the txn.  This mitigates dirty reads by other
> txns, but at the expense of excessive db writes.
>
>Gene


-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Adena Galinsky
Sent: Monday, August 28, 2000 11:08 AM
To: [EMAIL PROTECTED]
Subject: Re: cache


Is it true that a client must explicitly start a transaction using
javax.transaction.UserTransaction? As I understood it, each method call to
either an entity bean or a session bean represents a transaction.  (putting
aside for a moment the deployment transaction settings which might force a
method to start a new transaction)

Also, is it true that if you start a txn in a session bean, call a bunch of
entity bean methods and then commit(), ejbLoad() and ejbStore() will only be
called once in the entity bean: Load() before the first entity bean method
called and Store() after the last one?

-Adena

-----Original Message-----
From: Gene Chuang [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 28, 2000 1:01 PM
To: [EMAIL PROTECTED]
Subject: Re: [EJB-INT] cache


Hi,

If your entity bean is a regular read-write entity bean, then it's ejbLoad
will only at the beginning of a txn.  Hence if your client calls your
session bean , say, twice within a txn, and it calls the entity bean's
method twice, then ejbLoad will only be called once.

Another session bean will NOT be able to concurrently modify this same
entity bean while the 1st session bean has txn lock on it.

Gene

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Ashish Deshpande
Sent: Friday, July 28, 2000 1:35 AM
To: [EMAIL PROTECTED]
Subject: Re: cache


Since it says that the entity bean is not invoked every time the client
makes a
call and
minimizes our database access, thus, improving overall system
performance.
My question is, how the session bean comes to know whether to call the
entity
bean method or send the data from the cache?

regards,
Ashish

Hemant Khandelwal wrote:

> Everytime a method on entity bean is called in some transaction context,
the
> container calls ejbLoad to synchronize entity bean state with the
dataBase.
> So its the containers responsibility to call ejbLoad method. In the bean
you
> will write whatever state is there to synchronize.
>
> Hemant
> ----- Original Message -----
> From: "Ashish Deshpande" <>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, July 28, 2000 12:13 PM
> Subject: cache
>
> Hello,
>
> If we get the references to the home interface of the entity beans in
> setSessionContext() method of a stateless session bean, it says that
> the entity bean is not invoked every time the client makes a call and
> minimizes our database access, thus, improving overall system
> performance.
>
> But suppose there are many instances of the session bean, how these
> instances get notified whether there is a change in the database or not?
>
> regards,
> Ashish
>
>
===========================================================================
> 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".

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