Hi,
Specs says that the container must call the  ejbLoad before transaction
starts and must call ejbStore after a transaction is over. So
synchronisation also depends on the  Transaction attributes of the method
you have given. Thus in your case if the setter method is associated with
the transaction then the values will be updated in the datebase before your
next function is called.


Thanks & Regards
Ashwani Kalra
Systems Executive,
NIIT Ltd.


> ----------
> From:         Heiko Gottschling[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list for Enterprise JavaBeans development
> Sent:         Friday, January 05, 2001 5:03 PM
> To:   [EMAIL PROTECTED]
> Subject:      Entity Bean / database synchronization issues
>
> Hi,
>
> as I understand the specification, it is up to the container to
> synchronize
> existing entity bean instances with the DB, i.e. the bean developer must
> not
> make any assumptions as to when the ejbStore() / ejbLoad() methods are
> called.
>
> If this is the case, how is consistency preserved if the tables associated
> with the enitity bean is accessed "behind the bean's back"? Imagine
> something
> like this:
>
>   orderItem.setPrice(100.00);
>   statement.execute("SELECT SUM(price) FROM OrderItem WHERE
> OrderID=1234");
>
> Here the price column of an OrderItem record (represented by an entity
> bean)
> is updated and the table is queried immediately after. For this to work,
> the
> entity bean must have been written to the database before the execution of
> the SELECT statement. How is data integrity guaranteed in this case?
>
> thx
> Heiko
>
> ==========================================================================
> =
> 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