Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

@Unique query 1

Status
Not open for further replies.

domino1352

IS-IT--Management
Nov 20, 2002
40
AU
when @unique generates its result
what does it use to seed the result. i.e does it use servername,timedate,database, if so if an there are two identical agents running and at the same time run the 2unique command on the same server,same DB with the result be the same,
reason I ask is that I have just run the archiving agent on a large dom.doc DB and now when I retreive SOME docs I get the wrong document back. looking at the code it uses @unique to create file names and I was wondering , that if the agent was run twice (due to the face that the first agent was still running when the next time it was due to start) that it overwrote some of the origional file names...


regards George Savery gsavery@b2btech.com.au
 
@unique is not, unfortunately, living up to its name.
If you use it as a unique number generator, you are making a big mistake.
Unfortunately, the mistake is not yours, it is Lotus's.
The worst thing is that the document explaining how @unique actually works has been pulled from Lotus forums.

So, from memory, I can say that @unique is an algorythm based on the users full name. Basically, it takes the first letter of each part of the user's name, and completes with letters from the last name until it gets 4 letters. It then adds a key based on the date-time stamp.
Given that the algorythm is predictable, you can see that the first part - name-based - is highly UN-unique.

For example, my name (Pascal Monett) gives a letter key of PMOT. A person named Philip Mocart (invented) would have the same letter key.

In addition, think of this : even if you are connected to the server when using the function, it is the client that calculates the result. So this so-called unique function is not even centrally managed by the server, but is instead recalculated individually every time. Is that supposed to be a guarantee of reliability ?

In short, @Unique is a VERY BAD way to make a unique key. It is a great shame that Lotus induces people to think that such a function is actually capable of creating a unique key. Worse, the fact that Lotus is not clearly explaining HOW the key is created (and is actually covering it up) is bordering on scandalous.

I think that your retrieval issues are more due to the unreliability of @Unique then to concurrent-creation issues.

To make sure, you can simply make a view that lists all documents by their key. In my opinion, you will certainly find identical instances. Of course, mistakes in agent reliability are not to be discounted, but in this case they would compound the problem, not create it.

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top