Hi Esteban,yes, Mongo is not very communicative ;-)I replaced OID>>nextOID with my own RKAOIDGeneratornextOID^self value: (RKAOIDGenerator getNextOID)instead ofnextOID^self value: (UUIDGenerator default makeSeed)RKAOIDGenerator uses Time>>primMillisecondClock at startup and adds +1 each time I getNextOID as you suggested.This works fine. It seems to be much much much faster than the existing solution.[4000 timesRepeat: [UUIDGenerator default makeSeed]] timeToRun ==>> 5817[4000 timesRepeat: [RKAOIDGenerator getNextOID]] timeToRun ==> 1 (!!)Perhaps a solution like this would be a better solution for all because it is faster and guarantees unique IDs?SabineOn Fri, Aug 30, 2013 at 5:58 PM, EstebanLM [via Smalltalk] <[hidden email]> wrote:
Hi,
One idea (not sure if it will work)
You can take
Time primUTCMicrosecondsClock
when system start, then increase it sequentially.
most probably that will ensure uniqueness while providing fast ids.
but of course, that depends, you need to check in your system.
I'm thinking on provide different ID generators for Voyage, and let people plug what is more convenient for them.
(all of this happens because, unlike other db drivers, mongo does not answer the inserted id :( )
Esteban> --
> So, I will wait and till then, use the solution of Jan.
> Thank you, Jan for the file in.
> Sabine
>
>
>
> View this message in context: http://forum.world.st/voyage-mongo-randomly-wrong-OIDs-tp4705396p4705821.html
http://forum.world.st/voyage-mongo-randomly-wrong-OIDs-tp4705396p4705827.htmlIf you reply to this email, your message will be added to the discussion below:
View this message in context: Re: voyage/mongo randomly wrong OIDs
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.