>
> We currently have a DAO class contained in a common utility
> jar within our EAR file.  Up to this point most of our
> Databases access has occurred through the use of entity
> beans, but we're looking to move more to DAOs. Here is the problem:
>
> While using entity beans, we employed a PrimaryKeyGenerator
> entity bean during inserts.

Of course, this is a HI-LO key generator, right?

> Now that we moved some of our
> database logic out of the entity beans and into this DAO
> class which is now outside of the EJB jar, how can we
> generate primary keys?  It is my understanding that having
> code within a common jar that is included in the EAR make a
> call to EJB code is in violation of the J2EE paradigm.

I disagree. The thing is, who calls the jar? Probably other EJBs, right?
Then you can call.
Alternatively, you could place all the key generation code inside your
DAO, both key generation and database code, and use JDBC directly(it
should be quite simple, usually HI-LO generators use a table with 2 or 3
fields)

My 2c,

JP

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