I think your session bean have to be bean managed transaction
(<transaction-type>Bean</transaction-type>).
You should begin a transaction to read your table, increment (cnt = cnt +
1), update table, commit transaction.
Then you shouldn't have problem with concurrent access.

SAINT-MARTIN Cecile
[EMAIL PROTECTED]

> -----Message d'origine-----
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]De la part de L. Yeung
> Envoye : vendredi 13 juillet 2001 05:53
> A : [EMAIL PROTECTED]
> Objet : [JBoss-user] Auto-incr
>
>
> jboss-user:
>
> i have decided to create a table "Trans" with a pk
> "transno" of type bigint without auto-increment
> defined. next i created a table "counter" with one
> field "cnt" which stores the last value of "transno"
> of table "Trans". I have an autonumber entity bean
> (cmp) to map this bean to table "Counter", which
> provides the value of "cnt" for later retrieval. next
> i wrote a session bean called AutoNumberManager to
> provide the actual increment logic ("cnt = cnt + 1").
> with this approach, should i worry client's concurrent
> access of AutoNumberManager sesion bean?
>
> thanks in advance.
>
> -l. yeung
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


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

Reply via email to