Class SmartIdGenerator
java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.dao.SmartIdGenerator
Allows to generate ids in bunches. Usually, generates more ids than required and stored them in memory.
It allows to avoid contacting the DB again for the consecutive requests.
Cached ids for different generators are stored independently.
- Since:
- 9.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Ids should be retrieved immediately. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateIds
(org.hibernate.id.IdentifierGenerator identifierGenerator, Object fakeObject, int numberOfIdsToGenerate)
-
Field Details
-
TIMEOUT_LOCK_MINUTES
public static final int TIMEOUT_LOCK_MINUTESIds should be retrieved immediately. If ids cannot be retrieved in 10 min, it makes sense to throw an exception and fail the job, so the system can heal itself.- See Also:
-
-
Constructor Details
-
SmartIdGenerator
-
-
Method Details
-
generateIds
public Collection<Object> generateIds(org.hibernate.id.IdentifierGenerator identifierGenerator, Object fakeObject, int numberOfIdsToGenerate)
-