I'm glad that you guys think this is a good strategy. It works fine normally
but it's under
load that it seems to pack up. I'm using mysql and an implementation of
Floyd's sequence
entity bean and sequence session bean pattern. (The code is below).
We actually are getting a TransactionRollBack exce
ption ("Something weird happened, couldn't
create " + sequenceName);
ce.printStackTrace ();
}
}
/**
* @ejb.interface-method
*/
public int getPrimaryKey ( String sequenceName )
{
return getSequence (sequenceName).getNextValue ()
There has been much discussion on database and container independent
primary key
generation strategies. I've been using the first strategy in Floyd
Marinescu's book
ftp://www6.software.ibm.com/software/developer/library/j-ejbdesign.pdf
but have been getting transaction roll-back exceptions.
Y
I use that strategy too. I got a KeyGeneratorBean that keeps track of
the nextValues per "class" (uses an underlying database table). I
currently do not have any problems (but still got to test it under
load)...
If you want I can share my code so you can take a look...
++Jos.nl
And thus it came
Hi all,
There has been much discussion on database and
container independent primary key
generation strategies. I've been using the first
strategy in Floyd Marinescu's book
ftp://www6.software.ibm.com/software/developer/library/j-ejbdesign.pdf
but have been getting transaction roll-back