How to refresh CMP Bean data?
843829Sep 10 2002 — edited Apr 11 2004Hi,
I'm trying to develop a CMP bean on a DB table that has a column defined as "auto increment", i.e. I don't set any value for this attribute in ejbCreate() and the DB manager sets it when the row is inserted.
In order to get the value assigned to the column in the same client method that created it, I invoke a finder that retrieves the just created Bean by looking for another column value.
To my dismay, the contents of the "auto increment" attribute is still null, which suggests that either the container has not yet performed the insert in the DB, or it performs a first search in its storage instead of accessing the persistent media.
How can I force the container to immediately store the bean in the DB and refresh its data to get the automatically generated value? I suppose I could do it with a BMP (right?), but I'd rather use a CMP if possible.
Thanks for any suggestion that can help,
Pere Torrodellas