google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

ObjectifyService.register() IllegalArgumentException Unnecessary? #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In some use cases, calling register() multiple times is nearly impossible to 
prevent. e.g. preventing multiple calls to register() when using the Google 
MapReduce library. The exception thrown seems highly unnecessary, and a simple 
log message could be used, instead of having to wrap register() in a try-catch 
block.

Thanks

Original issue reported on code.google.com by m...@rickybutton.com on 1 May 2011 at 4:05

GoogleCodeExporter commented 9 years ago
Put your registration in a static initializer block, the JVM will guarantee 
that it is called once and only once.  This should not be a difficult issue - I 
suspect you are doing something very wrong.

Original comment by lhori...@gmail.com on 9 May 2011 at 10:29

GoogleCodeExporter commented 9 years ago
In any case, new Objectify4 behavior is to ignore re-registrations.

Original comment by lhori...@gmail.com on 16 Dec 2011 at 2:31