GAE @Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE) 不生成序号

GAE @Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE) not generating sequential numbers

我有一个字段:

当我把它放进去时:

它不是按顺序生成的

序号不对是什么原因?我将在 2 个单独的 post 中添加日志,因为它们对于这个 post.

来说太大了
1:1422624487.413000 [s~server-test-killesk/12.381882801386260762].<stdout>: 13:28:07,413 DEBUG Request FC14E205 ValueGeneration:debug:58 - Creating ValueGenerator instance of "com.google.appengine.datanucleus.valuegenerator.SequenceGenerator" for "com.eurekaapp.server.dao.mappedobjects.DAOJobEvent.sequence"
1:1422624487.424000 [s~server-test-killesk/12.381882801386260762].<stdout>: 13:28:07,423 DEBUG Request FC14E205 ValueGeneration:debug:58 - Generated value for field "com.eurekaapp.server.dao.mappedobjects.DAOJobEvent.sequence" using strategy="sequence" (Generator="com.google.appengine.datanucleus.valuegenerator.SequenceGenerator") : value=1,050,002
1:1422624487.624000 [s~server-test-killesk/12.381882801386260762].<stdout>: 13:28:07,624 DEBUG Request FC14E205 ValueGeneration:debug:58 - Generated value for field "com.eurekaapp.server.dao.mappedobjects.DAOJobEvent.sequence" using strategy="sequence" (Generator="com.google.appengine.datanucleus.valuegenerator.SequenceGenerator") : value=1,040,003
1:1422624487.908000 [s~server-test-killesk/12.381882801386260762].<stdout>: 13:28:07,907 DEBUG Request FC14E205 ValueGeneration:debug:58 - Generated value for field "com.eurekaapp.server.dao.mappedobjects.DAOJobEvent.sequence" using strategy="sequence" (Generator="com.google.appengine.datanucleus.valuegenerator.SequenceGenerator") : value=3,010,003

IdGeneratorStrategy.SEQUENCE 是在 DatastoreService.allocateIds() 之上实现的,这就是 Cloud Datastore 内部分配 ID 的方式。适用于 Cloud Datastore 自动 ID 分配的所有内容都适用于 SEQUENCE。

序列只保证唯一,不保证单调递增。