try {
// TODO: Reuse at central point
Context ctx = new InitialContext();
SequenceServiceHome home = (SequenceServiceHome)ctx.lookup("nordija.portal.sequence");
SequenceService seq = home.create();
Range range = seq.getSequenceRange("User",true,1);
// Init values
setID(range.getNextUniqueNumber());
} catch(javax.naming.NamingException ne) {
throw new java.rmi.RemoteException("Error while looking up the Sequence service",ne);
} catch(javax.ejb.CreateException ce) {