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.

Is there some reason why this won't work or is infeasible? Is an entity bean
for this purpose considered too expensive?

Laurel

-----Original Message-----
From: Pavan Venkata Tirunagari [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 29, 2000 1:58 AM
To: [EMAIL PROTECTED]
Subject: Sequence no generation


Hi all

I have a requirement of generating the sequence numbers making use of EJBs
and helper classes.

My helper class has the logic of forming the sequence number reading the
format information and data information from respective table.

I am calling the helper class method in the EJB method for sequence no
generation.

since the thread management is done by the EJB container I am facing the
problem of generating sequence numbers when multiple clients are accessing
the bean.


I have tried putting the logic of forming the sequence number in an another
bean.This also is not a feasible solution.

I am stuck up.what I feel is the auto sequence number generation cannot be
done by making use of EJBs.
Please clarify me of the above statement and give me a feasible solution by
making use of EJBs if any.

thanks in advance
Pavan

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