>
> Why isn't it feasible to use an entity bean to hold the
> sequence numbers?
> One solution I have seen is as follows:
>
> DBMS has the following table (with some samle data filled in):
>
> EJB_ID || Next_Sequence_Number
> ------------------------------
> ACCT   ||    109
> CAT_NO || 234511
>
> EJB_ID identifies the bean type that the sequence number is
> for ... for
> example, the next sequence number for account (ACCT) is 109,
> and the next
> sequence number for catalog item (CAT_ITEM) is 234511.
>
> You would then have an entity bean SequenceNumberGenerator
> that maps to that
> table. You don't have to worry about threads or concurrency, since the
> container does that for you.
>

If your app server can guarantee exclusive locking for an entity, then this
may well work (not concurrently, though - transactions will be effectively
serialized). However, most app servers will not guarantee exclusivity in a
clustered environment.


- Avi
--
This signature intentionally left blank.

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