Java – what is the correct way to increment counters atomically in App Engine?

I use Java on Google App Engine, and I am most familiar with JDO data store interface I'm trying to implement a simple download counter that stores its data in the App Engine data store

I only expect to download a few thousand per month, so the update rate of my counter will be very low Therefore, I am not interested in analyzing counters

In fact, I may ignore the lock and accept that I occasionally lose updates However, I want to know what the right way is to do without losing any updates I know I use synchronization in pure Java, but I don't know what the equivalent mechanism is in the data store

Solution

According to your requirements, there are many ways to do this, including slicing The other option is described as here

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>