Discussion:
can I use java.util.UUID on client-side?
Slava Lovkiy
2010-11-22 21:28:11 UTC
Permalink
Hi,

Is there a way to be able to use the same java.util.UUID.randomUUID()
generator on server and client side?

This might be particular useful, when some ids needs to be generated
on the client and then persisted on the server.

Is there a better solution to solve the more general problem - some
entities may originate on the client and a complex graph can be
created with relatationships bases on ids. The ids must be globally
unique after persisting data on server.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Jim Douglas
2010-11-22 21:40:41 UTC
Permalink
For the general question of "Is [x] implemented in GWT", bookmark:

http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html

For possible GWT-friendly UUID implementations, see:

http://www.google.com/search?q=gwt+uuid

FWIW, when I need a UUID in my GWT application, I find it easiest to
generate it on the server, then send it to the client.
Post by Slava Lovkiy
Hi,
Is there a way to be able to use the same java.util.UUID.randomUUID()
generator on server and client side?
This might be particular useful, when some ids needs to be generated
on the client and then persisted on the server.
Is there a better solution to solve the more general problem - some
entities may originate on the client and a complex graph can be
created with relatationships bases on ids. The ids must be globally
unique after persisting data on server.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Peter Ondruska
2010-11-23 06:26:04 UTC
Permalink
you may use http://uuid-service.appspot.com
Post by Jim Douglas
http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
http://www.google.com/search?q=gwt+uuid
FWIW, when I need a UUID in my GWT application, I find it easiest to
generate it on the server, then send it to the client.
Post by Slava Lovkiy
Hi,
Is there a way to be able to use the same java.util.UUID.randomUUID()
generator on server and client side?
This might be particular useful, when some ids needs to be generated
on the client and then persisted on the server.
Is there a better solution to solve the more general problem - some
entities may originate on the client and a complex graph can be
created with relatationships bases on ids. The ids must be globally
unique after persisting data on server.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Slava Lovkiy
2010-11-23 12:26:05 UTC
Permalink
Current solution i have is to generate a batch of guids on the server,
send it to the client once, at the initialisation of the app. Client
will use the guids from the batch, gradually exhausting the pool. The
refill of the pool is done when it is about to run out of available
guids using asynch call to the server.

This solution has one flaw: due to the fact of asynchronous nature of
guids pool refill, client may run out of guids completely, throwing an
error something like 'outOfIndex'. So, it would be much easier to have
guid generated available to the client to avoid the issue above.
Post by Jim Douglas
http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
http://www.google.com/search?q=gwt+uuid
FWIW, when I need a UUID in my GWT application, I find it easiest to
generate it on the server, then send it to the client.
Post by Slava Lovkiy
Hi,
Is there a way to be able to use the same java.util.UUID.randomUUID()
generator on server and client side?
This might be particular useful, when some ids needs to be generated
on the client and then persisted on the server.
Is there a better solution to solve the more general problem - some
entities may originate on the client and a complex graph can be
created with relatationships bases on ids. The ids must be globally
unique after persisting data on server.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Peter Ondruska
2010-11-23 12:54:33 UTC
Permalink
Why not firing request for new GUID group right after you receive
asynch reply. Thereby you would always have fresh group of GUIDs
available (given you request big enough group).
Post by Slava Lovkiy
Current solution i have is to generate a batch of guids on the server,
send it to the client once, at the initialisation of the app. Client
will use the guids from the batch, gradually exhausting the pool. The
refill of the pool is done when it is about to run out of available
guids using asynch call to the server.
This solution has one flaw: due to the fact of asynchronous nature of
guids pool refill, client may run out of guids completely, throwing an
error something like 'outOfIndex'. So, it would be much easier to have
guid generated available to the client to avoid the issue above.
Post by Jim Douglas
http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
http://www.google.com/search?q=gwt+uuid
FWIW, when I need a UUID in my GWT application, I find it easiest to
generate it on the server, then send it to the client.
Post by Slava Lovkiy
Hi,
Is there a way to be able to use the same java.util.UUID.randomUUID()
generator on server and client side?
This might be particular useful, when some ids needs to be generated
on the client and then persisted on the server.
Is there a better solution to solve the more general problem - some
entities may originate on the client and a complex graph can be
created with relatationships bases on ids. The ids must be globally
unique after persisting data on server.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Peter Ondruska
2010-11-23 12:55:23 UTC
Permalink
I can change the http://uuid-service.appspot.com to allow requesting
group of UUID for a single request.
Post by Slava Lovkiy
Current solution i have is to generate a batch of guids on the server,
send it to the client once, at the initialisation of the app. Client
will use the guids from the batch, gradually exhausting the pool. The
refill of the pool is done when it is about to run out of available
guids using asynch call to the server.
This solution has one flaw: due to the fact of asynchronous nature of
guids pool refill, client may run out of guids completely, throwing an
error something like 'outOfIndex'. So, it would be much easier to have
guid generated available to the client to avoid the issue above.
Post by Jim Douglas
http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
http://www.google.com/search?q=gwt+uuid
FWIW, when I need a UUID in my GWT application, I find it easiest to
generate it on the server, then send it to the client.
Post by Slava Lovkiy
Hi,
Is there a way to be able to use the same java.util.UUID.randomUUID()
generator on server and client side?
This might be particular useful, when some ids needs to be generated
on the client and then persisted on the server.
Is there a better solution to solve the more general problem - some
entities may originate on the client and a complex graph can be
created with relatationships bases on ids. The ids must be globally
unique after persisting data on server.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Loading...