Oracle's sequences are built for just such an environment, you can tune the
caching and of course you can tune the free lists of your tables. If
possible grab the sequence # at the same time you go to the database to use
it, possibly in an anonymous PL/SQL block or stored procedure. People have
built many applications with this feature before EJB, it works.
Cheers
Jay Walters
-----Original Message-----
From: Krishna Kumar [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 24, 2000 4:38 AM
To: jBoss
Subject: [jBoss-User] Unique transaction number
Hi folks
i am sure this has been discussed before if so please point me to the
correct thread / message,
Recently i came across a peculiar problem we have several transactions which
required sequence number , now this number has to be generated and handed
out fast enough!!! So it kind of rules out putting it in a db and
accessing it!!!
So i hit upon a simple solution of putting a sequence number in a hash table
and looking up the number whenever i required one!!
The situation was okie with a few users but with a few more users it was no
more thread safe!!! So i synchronised on the method...
Now how do i do the following
1) Make it instance safe as more than one bean could be in my pool and they
could do a update it and lead to dirty reads??
2) How do i make sure it is cluster safe??
3) How do i ensure even if the server goes down the last value of the
transaction number gets saved in the db and i can start afresh from there
on!!!
4) I am trying to do a sequence number in Oracle a) becos it is database
specific
b) the overhead and contention on it will be quite high!!
Is there any other approach , please let me in how u folks go about it
normally...
warm regards
Many thanks in advance
krishna kumar
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]