Yes this works. Thanks
On Thursday, January 26, 2017 at 9:23:22 AM UTC+1, Luigi Dell'Aquila wrote: > > Hi Alberto, > > please try to replace this > > OSequenceLibrary sequenceLibrary = access.graph > .getRawGraph().getMetadata().getSequenceLibrary(); > > with this > > OMetadata md = access.graph.getRawGraph().getMetadata(); > md.reload(); > OSequenceLibrary sequenceLibrary = md.getSequenceLibrary(); > > Maybe it's just a matter of caching > > Thanks > > Luigi > > > 2017-01-26 0:07 GMT+01:00 Maverick <[email protected] <javascript:>>: > >> Each time this code is executed, a new sequence is created with the same >> name, and so the method always returns 1 as next number. Why? >> >> >> public long next( String seqName ) { >> >> OSequenceLibrary sequenceLibrary = access.graph >> .getRawGraph().getMetadata().getSequenceLibrary(); >> >> OSequence seq = sequenceLibrary.getSequence( seqName ); >> >> if( seq == null ) { >> >> seq = sequenceLibrary.createSequence(seqName, SEQUENCE_TYPE.ORDERED, new >> OSequence.CreateParams().setStart(0L)); >> >> } >> >> return seq.next(); >> >> } >> >> >> I'm using graphdb v.2.2.13 >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OrientDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
