Hey

> Damon Williams wrote:
> When using Entity Beans w/ container managed persistence, when does
> the actual committing of changes to the underlying database take
> place?   I thought it was whenever the data fields in the Bean object
> changed.  But, in my code I alter the Bean's data (after performing a
> findByPrimaryKey() ), and then do a SQL query to check the database -
> and the old data is still there.  The Bean is persistent - even after
> rebooting my machine the "new" data is there the next time I do a
> findByPrimaryKey() but what about the legacy system I am integrating
> with?  How will they know what the new data is if the database record
> has not changed!

When the transaction commits the updates should be stored. If you're not
using transactions it is somewhat undefined when the stores should
occur.

> I could put an SQL UPDATE line in my Bean's ejbStore() method, but
> isn't that defeating the purpose of container-managed persistence?

Yep, that would not be a good idea. You could do a System.out.println in
ejbStore and see when, or rather if, it gets called at all.

/Rickard

--
Rickard �berg

Computer Science student@LiTH
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

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