if (en instanceof PName) {
//Naming context role
if (((PName) en).getPNameManager() == this) {
return (PName) en;
} else {
return new RdbSequencePName(this, en);
}
}
//Binder role
PBindingCtrl pb = (PBindingCtrl) en;
byte nextstate = PStateGraph.nextStatePBinding(pb.getStatus(),
PBinding.ACTION_EXPORT);
if (nextstate == PBinding.LIFECYCLE_ERROR)
throw new PExceptionProtocol("Unauthorized operation");
PName pn = null;
boolean connectionAllocatedLocaly = false;
try {
if (c == null) {
c = getBinderClassMapping().getPMapper().getConnection();
connectionAllocatedLocaly = true;
}
initSequenceHelper();
long lid = ((Long) sequence.next()).longValue();
//TODO : if factory, lid = factory.next
pn = new RdbSequencePName(this, new Long(lid));
} finally {
if (connectionAllocatedLocaly) {
getBinderClassMapping().getPMapper().closeConnection(c);
} else if (c instanceof ConnectionHolder) {
try {