-
1. Re: is there a what to create a read/write application varia
jamesstrachan Jan 24, 2004 8:51 AM (in response to purdym)You can't do this with an environment variable because it is not what they are there for.
You need to use an entity bean that contains the last issued number, and can supply calling modules with the next number, as shown :-
int getNextNumber() {
storedNumber++;
return storedNumber;
}
The method ejbStore() will be called immediately after this method executes, and should wite the changed value to somewhere safe.
I would have attached, if I was allowed, a fuller example that copes properly with persistence to the database, and also allows for more than one sequence each identified by a key.
Contact me directly on james.strachan@ntlworld.com if you would like that code.
James -
2. Re: is there a what to create a read/write application varia
purdym Jan 26, 2004 7:25 PM (in response to purdym)i did not want to use the database for this, because i planned on querying the database only once when jboss boots for the last id number and then keep it in a variable. but i looks like i will need a table in the db for variables such as these.
thanx for your help,
mpurdy