Yep, I'm going though and making those changes now. Note that the
Queue documentation says, "Implementations of this interface must be
threadsafe." So that one's OK.

Vince

On Thu, Nov 5, 2009 at 12:57 PM, Roy Smith <[email protected]> wrote:
> Hi Vince
> I removed all of the static qualifiers from CachingDatastoreService and I
> instantiate it per request using Guice.
> best
> Roy
>
> On Thu, Nov 5, 2009 at 5:34 PM, Vince Bonfanti <[email protected]> wrote:
>>
>> OK, glad I asked. I assume then the same is true for MemcacheService,
>> since it's not explicitly marked as thread-safe?
>>
>> Vince
>>
>> On Thu, Nov 5, 2009 at 12:26 PM, Max Ross (Google)
>> <[email protected]> wrote:
>> > Since DatastoreService is not explicitly documented as thread-safe, and
>> > since static members are accessible across threads, you should not
>> > create a
>> > static DatastoreService instance and use it across threads.
>> >
>> > On Thu, Nov 5, 2009 at 5:34 AM, Vince Bonfanti <[email protected]>
>> > wrote:
>> >>
>> >> Hi Max,
>> >>
>> >> To your point to "assume that all classes in the api are _not_
>> >> threadsafe unless explicitly documented otherwise." Is there any
>> >> reason not to create a static DatastoreService instance within a
>> >> class:
>> >>
>> >>   private static final DatastoreService datastore =
>> >> DatastoreServiceFactory.getDatastoreService();
>> >>
>> >> Is this static DatastoreService going to be threadsafe?
>> >>
>> >> Vince
>> >>
>> >> On Wed, Nov 4, 2009 at 2:02 PM, Max Ross (Google)
>> >> <[email protected]> wrote:
>> >> > A DatastoreService instance is extremely lightweight so feel free to
>> >> > create
>> >> > them as-needed.  In addition, transactions are not tied to a specific
>> >> > DatastoreService instance but rather to the thread that started the
>> >> > transaction.  Finally, assume that all classes in the api are _not_
>> >> > threadsafe unless explicitly documented otherwise.
>> >> >
>> >> > Hope this helps,
>> >> > Max
>> >> >
>> >> > On Wed, Nov 4, 2009 at 4:35 AM, Roy <[email protected]>
>> >> > wrote:
>> >> >>
>> >> >> Should I be creating a DatastoreService for each "session", or are
>> >> >> they inexpensive enough that I can have one for each Kind? I realise
>> >> >> that for transactions, the latter doesn't work.
>> >> >>
>> >> >> A related question is how threadsafe is an instance of
>> >> >> DatastoreService?
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > >
>> >> >
>> >>
>> >>
>> >
>> >
>> > >
>> >
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to