English 中文(简体)
是否有必要打破僵局?
原标题:Does bigtable need locking?

我正在使用在GAE的某些数据更新的任务。

我的问讯。

  <queue> 
    <name>data-processing</name> 
    <rate>20/s</rate> 
  </queue> 

My queue processing servlet decrease credit by 1 for every task. While processing it need to check for credit availability and proceed further only if credit is available.

信贷储存在一张桌上,一旦任务完成,就会更新。

我将这些任务视为read子,并对私刑问题表示担忧。

what if 2 or more tasks query/update credit table simultaniously? Do i need to create some locking mechenism? If yes then how?

最佳回答

你们确实需要同步。 通常,你将更新“改写标准”计划中的贷项:首先读出现有贷项,减去一个,并写出剩余的贷项。 如果两项任务同时完成,一项任务可能会超出另一项任务的结果,导致储存的信贷不正确。 (除非对Memcache有这方面的原教旨,但不适用于I号数据库。)

http://code.google.com/appengine/docs/java/datashop/transactions.html”rel=“nofollow noreferer” http://code.google.com/appengine/docs/java/datashop/transactions.html

问题回答

上诉人任务小组负责对执行率进行会计核算。 你不需要像你已经做的那样做任何事情。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签