So after all the brain racking I came up with a probable neat way of ensuring that the numbers were unique using JNI!!. I wrote a simple "C" API that concatenated the MAC address of the machine with the EPOC timestamp and the time since last reboot in nanoseconds. This have me a 16 bit number that was unique to the nanosecond. Well, I have a unique identifier now, But how could I use it was my next hurdle.
After a little more pondering (googling and discussing approach methodologies with friends), I realized that with JNI available, life of bridging the gap between java and native code was made much simpler.
I used the tutorial written by Beth Sterns to build my JNI Interface. So if any of you out there ponder on how to use and build JNI interfaces, I'd recommend the Beth Sterns Tutorial anyday !!!. It sure did make my life easy, and I bet it would do the same to yours too..
There also is a MAC OS Runtime for thos MAC geeks.
"Note that the ability to load dynamic libraries is subject to approval by the current security manager. When working with native methods, you must load dynamic libraries. Some applets may not be able to use native methods because the browser or viewer they are running in restricts the ability to load dynamic libraries. See Security Restrictions for information about the security restrictions placed on applets. "
Posted by Steve on May 12, 2005 at 06:38 AM EDT #
Posted by Derek Morr on May 12, 2005 at 08:14 AM EDT #
When using sequential ID's, especially when the provisioning happens from different systems, it's hard to maintain a track of the last sequencial number in use, for example. <strong>LDAP</strong> server runs on <strong>Machine A</strong>, the 2 boxes provisioning to it are <strong>Machine B</strong> and <strong>Machine C</strong>.
If <strong>Machine B</strong> obtains the last sequential number from <strong>Machine A</strong>, increments it and adds a new entry, <em>IF IT TAKES A WHILE</em> <strong>Machine C</strong> may have procured a sequential number from <strong>Machine A</strong> after <strong>Machine B</strong> but provisioned faster...
well, when we look at this from a wide angle and spuer fast provisined entried, there could be a problem... especially when we deal with millions of entries...
Posted by Rohan Pinto on May 12, 2005 at 08:58 AM EDT #
Class UUID is a good option if all LDAP addition operations are performed on the same box. In my reply to Steve, I <em>kind of</em> briefly explained a scenario whereby the addition of entries may not necessarily be from a single subsystem but rather from an array of subsystems and maintaining the UID uniqueness across the enterprise array could be an issue... especially when using the ldap_add, ldap_add_s, ldap_add_ext functions from a native layer...
BTW: <em>I'm not using OpenLDAP</em>. The links may lead you to OpenLDAP MAN pages.. I just used them as an example...
<strong>ALSO: </strong> the provisioning happens from not only various systems, but from applications that are a combination of java and C. The Class UUID functions could be used if all the provisioning apps are java, but when we have a series of C apps provisioning in conjuntion with java apps, then we have a issue with using the Class UUID class.
Posted by Rohan Pinto on May 12, 2005 at 10:06 AM EDT #
Posted by Steve on May 13, 2005 at 06:54 AM EDT #