> > Suppose that I want to atomically create an entity group with two > > nodes, one the parent of the other. > But *why* exactly do you want to do this?
Because I want "a set of one or more entities that can be manipulated in a single transaction. Entity group relationships tell App Engine to store several entities in the same part of the distributed network. A transaction sets up datastore operations for an entity group, and all of the operations are applied as a group, or not at all if the transaction fails." > In your original email, you > said "Is there any way to get the hostname, IP, or MAC address where > the GAE app is running?", which is a fundamentally flawed question. > Your App Engine application doesn't run on a single machine, IP or MAC > address, because it runs on potentially hundreds of machines > concurrently. If you're wanting to use the aforementioned details to > get a unique identifier you're also doomed to failure, because there's > no guarantee that there will be only one instance of your application > on a machine at any one time. The fact that GAE uses many machines and concurrently is why the full hostname, IP, or MAC address or some other machine identifier is useful in creating a unique identifier on GAE. (If my application always ran on the same machine, the process id and time would be sufficient.) Network identifiers, such as MAC, full hostname, and IP, are very likely to be unique at a given time within a given network environment, such as Google. (Yes, even across datacenters.) However, a given machine may be running multiple processes, so it's possible that time.time() will return the same time in different processes. However, since GAE instances run in single-threaded processes and process ids at a given time are unique on a given machine, the triple(machine id, time, processid,) is unique. Yes, I realize that time being reset or time inconsistencies between different machines (that happen to have the same IP or hostname at different times) can cause duplication. That's low enough probability that I can live with it (and I can use urandom to reduce the odds still more). On Nov 21, 9:21 pm, "David Symonds" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 22, 2008 at 1:10 PM, Andy Freeman <[EMAIL PROTECTED]> wrote: > > Entity groups are named by the key of the root, which can be > > constructed from a kind and a key name. > > Okay, that's not really the entity group being named, but the root > entity being named. > > > Suppose that I want to atomically create an entity group with two > > nodes, one the parent of the other. > > But *why* exactly do you want to do this? In your original email, you > said "Is there any way to get the hostname, IP, or MAC address where > the GAE app is running?", which is a fundamentally flawed question. > Your App Engine application doesn't run on a single machine, IP or MAC > address, because it runs on potentially hundreds of machines > concurrently. If you're wanting to use the aforementioned details to > get a unique identifier you're also doomed to failure, because there's > no guarantee that there will be only one instance of your application > on a machine at any one time. > > If you tell us more about *what* you're trying to achieve, rather than > *how* you think you can achieve it, we can give you a better idea. > > Dave. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---