I'd suggest you read the
EJB Spec, or better yet, read any of the dozens of books on EJB's. They all cover this process in detail.
What happens is that when the transaction ends that the new data (set using setter methods in the Entity bean) is written to the database with an UPDATE statement.
As to how it knows -- the simplest approach (which every container supports) is to simply write back ALL of the data from all of the EJB's used in the transaction with UPDATE statements. Smarter approaches use "dirty" flags to decide if any of the data has been changed (thus reducing the number of UPDATE statements). Only some containers support dirty flags
Kyle
------------------
Kyle Brown,
Author of
Enterprise Java (tm) Programming with IBM Websphere
See my homepage at
http://members.aol.com/kgb1001001 for other WebSphere information.
[This message has been edited by Kyle Brown (edited January 01, 2002).]