UUID generator in GS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

UUID generator in GS

Bob Tucker-2
Has anyone ported or created a UUID (GUID) generator in GemStone smalltalk?  Have been looking at VWs version but wondered if there was some prior art already out there.

TIA

--
-B-

"If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on."
- Steve Jobs


_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html

Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Norm Green-2
Bob,

In GemStone/64 version 2.3. and later, you can use persistent shared counters to do what you want.  See the category 'Persistent Counters' in System class.

Norm



From: "Bob Tucker" <[hidden email]>
To: [hidden email]
Sent: Wednesday, October 24, 2012 6:01:27 AM
Subject: [GemStone-Smalltalk] UUID generator in GS

Has anyone ported or created a UUID (GUID) generator in GemStone smalltalk?  Have been looking at VWs version but wondered if there was some prior art already out there.

TIA

--
-B-

"If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on."
- Steve Jobs


_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html



_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html

Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Bob Tucker-2
I understand about the persistent counters, but UUID is a specialized, allegedly guaranteed unique ID regardless of where and when created.  We have things that will go into a global DB (not owned by us) that requires a unique key generated by us since our customers need to have the key as well.

On Wed, Oct 24, 2012 at 12:16 PM, Norm Green <[hidden email]> wrote:
Bob,

In GemStone/64 version 2.3. and later, you can use persistent shared counters to do what you want.  See the category 'Persistent Counters' in System class.

Norm



From: "Bob Tucker" <[hidden email]>
To: [hidden email]
Sent: Wednesday, October 24, 2012 6:01:27 AM
Subject: [GemStone-Smalltalk] UUID generator in GS


Has anyone ported or created a UUID (GUID) generator in GemStone smalltalk?  Have been looking at VWs version but wondered if there was some prior art already out there.

TIA

--
-B-

"If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on."
- Steve Jobs


_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html





--
-B-

"If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on."
- Steve Jobs


_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html

Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Georg Gollmann
Am 24.10.2012 um 18:30 schrieb Bob Tucker <[hidden email]>:

> I understand about the persistent counters, but UUID is a specialized, allegedly guaranteed unique ID regardless of where and when created.  We have things that will go into a global DB (not owned by us) that requires a unique key generated by us since our customers need to have  the key as well.

Which UUID Version are you supposed to use?
Version 4 is just a fancily formatted random number.

Kind regards,
Georg
_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html

Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Dale Henrichs
In reply to this post by Bob Tucker-2
Bob,

There is a port of the Squeak UUID class that is used to generate UUIDs for Monticello packages. I've attached the source. The classes are written against the GLASS Squeak/Pharo compat layer, but it shouldn't be too hard to get it running in a stock GemStone ... if there are any "mystery methods/classes", let me know and I can supply additional source.

I don't have any test cases ported to GLASS, but there is a test suite for UUID in Pharo that would be useful.

Dale

----- Original Message -----
| From: "Bob Tucker" <[hidden email]>
| To: [hidden email]
| Sent: Wednesday, October 24, 2012 6:01:27 AM
| Subject: [GemStone-Smalltalk] UUID generator in GS
|
|
| Has anyone ported or created a UUID (GUID) generator in GemStone
| smalltalk? Have been looking at VWs version but wondered if there
| was some prior art already out there.
|
| TIA
|
| --
| -B-
|
| "If you haven't found it yet, keep looking. Don't settle. As with all
| matters of the heart, you'll know when you find it. And, like any
| great relationship, it just gets better and better as the years roll
| on."
| - Steve Jobs
|
|
| _______________________________________________
| GemStone-Smalltalk mailing list
| Archive: http://forum.world.st/Gemstone-Customers-f1461796.html
|
|

_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html


UUIDGenerator.gs (5K) Download Attachment
UUID.gs (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Bob Tucker-2
In reply to this post by Georg Gollmann
The default in VW is version 4 so that's the one I'm trying first.  I've gotten it to work but no idea how to vet it.

On Wed, Oct 24, 2012 at 1:26 PM, Georg Gollmann <[hidden email]> wrote:
Am 24.10.2012 um 18:30 schrieb Bob Tucker <[hidden email]>:

> I understand about the persistent counters, but UUID is a specialized, allegedly guaranteed unique ID regardless of where and when created.  We have things that will go into a global DB (not owned by us) that requires a unique key generated by us since our customers need to have  the key as well.

Which UUID Version are you supposed to use?
Version 4 is just a fancily formatted random number.

Kind regards,
Georg



--
-B-

"If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on."
- Steve Jobs


_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html

Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Bob Tucker-2
In reply to this post by Dale Henrichs
I got it mostly ported but missing MCPlatformSupport behavior.

On Wed, Oct 24, 2012 at 1:29 PM, Dale Henrichs <[hidden email]> wrote:
Bob,

There is a port of the Squeak UUID class that is used to generate UUIDs for Monticello packages. I've attached the source. The classes are written against the GLASS Squeak/Pharo compat layer, but it shouldn't be too hard to get it running in a stock GemStone ... if there are any "mystery methods/classes", let me know and I can supply additional source.

I don't have any test cases ported to GLASS, but there is a test suite for UUID in Pharo that would be useful.

Dale

----- Original Message -----
| From: "Bob Tucker" <[hidden email]>
| To: [hidden email]
| Sent: Wednesday, October 24, 2012 6:01:27 AM
| Subject: [GemStone-Smalltalk] UUID generator in GS
|
|
| Has anyone ported or created a UUID (GUID) generator in GemStone
| smalltalk? Have been looking at VWs version but wondered if there
| was some prior art already out there.
|
| TIA
|
| --
| -B-
|
| "If you haven't found it yet, keep looking. Don't settle. As with all
| matters of the heart, you'll know when you find it. And, like any
| great relationship, it just gets better and better as the years roll
| on."
| - Steve Jobs
|
|
| _______________________________________________
| GemStone-Smalltalk mailing list
| Archive: http://forum.world.st/Gemstone-Customers-f1461796.html
|
|



--
-B-

"If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on."
- Steve Jobs


_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html

Reply | Threaded
Open this post in threaded view
|

Re: UUID generator in GS

Dale Henrichs
Bob,

The MCPlatformSupport code is aimed at storing the `UUIDGenerator default` instance in `SessionTemps current`. The code predates the introduction of SessionTemps:)

If you are using the UUID code on multiple gems in the system, you might want to arrange to use a seed for the random number generator that is not based on time.

IIRC, the default seed for the random number generators are based on time and in Seaside we ran into the issue that multiple gems started "at the same time" could end with the same seed...which wasn't pretty:). To address the problem we salted the time seed with the session id (I can get the exact code to you if necessary).

On 3.1 we're using HostRandom which doesn't use seeds..

Dale

----- Original Message -----
| From: "Bob Tucker" <[hidden email]>
| To: "Dale Henrichs" <[hidden email]>
| Cc: [hidden email]
| Sent: Thursday, October 25, 2012 5:20:18 AM
| Subject: Re: [GemStone-Smalltalk] UUID generator in GS
|
| I got it mostly ported but missing MCPlatformSupport behavior.
|
|
| On Wed, Oct 24, 2012 at 1:29 PM, Dale Henrichs < [hidden email]
| > wrote:
|
|
| Bob,
|
| There is a port of the Squeak UUID class that is used to generate
| UUIDs for Monticello packages. I've attached the source. The classes
| are written against the GLASS Squeak/Pharo compat layer, but it
| shouldn't be too hard to get it running in a stock GemStone ... if
| there are any "mystery methods/classes", let me know and I can
| supply additional source.
|
| I don't have any test cases ported to GLASS, but there is a test
| suite for UUID in Pharo that would be useful.
|
| Dale
|
|
| ----- Original Message -----
| | From: "Bob Tucker" < [hidden email] >
| | To: [hidden email]
| | Sent: Wednesday, October 24, 2012 6:01:27 AM
| | Subject: [GemStone-Smalltalk] UUID generator in GS
| |
| |
|
|
| | Has anyone ported or created a UUID (GUID) generator in GemStone
| | smalltalk? Have been looking at VWs version but wondered if there
| | was some prior art already out there.
| |
| | TIA
| |
| | --
| | -B-
| |
| | "If you haven't found it yet, keep looking. Don't settle. As with
| | all
| | matters of the heart, you'll know when you find it. And, like any
| | great relationship, it just gets better and better as the years
| | roll
| | on."
| | - Steve Jobs
| |
| |
|
|
| | _______________________________________________
| | GemStone-Smalltalk mailing list
| | Archive: http://forum.world.st/Gemstone-Customers-f1461796.html
| |
| |
|
|
|
| --
| -B-
|
| "If you haven't found it yet, keep looking. Don't settle. As with all
| matters of the heart, you'll know when you find it. And, like any
| great relationship, it just gets better and better as the years roll
| on."
| - Steve Jobs
|
|
_______________________________________________
GemStone-Smalltalk mailing list
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html