>>>>> "Vincent" == Vincent Shek <[EMAIL PROTECTED]> writes:

    Vincent> Hi all,
    Vincent> What's the recommended way to use database sequence generator for use to =
    Vincent> generate primary key in CMP?

    Vincent> I am using Weblogic and it has its own solution of using =
    Vincent> <automatic-key-generation> in the deployment descriptor but obviously =
    Vincent> it's not a portable solution.

This subject gets beaten to death, but there is no "correct" solution.  At some
point, I think it's worthwhile to be pragmatic and accept that a large J2EE
application cannot be completely portable.  The key is to isolate platform and
tool dependencies so they can be reimplemented elsewhere.

In the case of Weblogic's primary key solutions, they are all specified in
Weblogic-specific deployment descriptors.  Other application servers will
likely work similarly.

You might consider looking at the book "EJB Design Patterns", by Floyd
Marinescu, which has a chapter titled "Primary Key Generation Strategies".  I
believe there is also a detailed article written by Scott Ambler which details
several different primary key strategies, but I don't remember where this is.

--
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]

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