On Sun, 25 Mar 2001, danch wrote:

> > 2. i have written a small set of CMP entity beans more or less along the
> > model in the o'reilly ejb book. now i'm looking to change them so that the
> > client doesn't have to manually choose a primary key when adding a new
> > entity, but i can't figure out how to do so. any clues? seems like this
> > would be pretty common.
>
> You can generate keys out of the database, with any of a variety of
> techniques. Often this is wrapped in a session or entity bean whose
> methods are set to 'RequiresNew' transactions (so locks on the key
> generating database mechanism are held for the shortest time possible).
> Your entity beans can then access this key generating bean from withing
> ejbCreate methods.

so the upshot is that the container can't manage this for you? that
strikes me as a tad silly, that CMP takes you this far but can't handle
this step - now i have to write code that assumes the existence of a sql
database and whatnot. oh well.

- donald


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to