Skip to content

Commit

Permalink
Merge pull request #568 from mobilemindtec/7.3.x
Browse files Browse the repository at this point in the history
Fix class java.lang.Double cannot be cast to class java.lang.Long on ID generation
  • Loading branch information
puneetbehl authored May 4, 2023
2 parents 7c10e5a + 494aa40 commit d84cf93
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ class MongoCodecEntityPersister extends ThirdPartyCacheEntityPersister<Object> {
Document result = dbCollection.findOneAndUpdate(new Document(MONGO_ID_FIELD, collectionName), new Document(INC_OPERATOR, new Document(NEXT_ID, 1L)), options)
// result should never be null and we shouldn't come back with an error ,but you never know. We should just retry if this happens...
if (result != null) {
return result.getLong(NEXT_ID)
final nextId = result.get(NEXT_ID, Number.class).longValue();
return Long.valueOf(nextId);
} else {
attempts++
if (attempts > 3) {
Expand Down

0 comments on commit d84cf93

Please sign in to comment.