Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

AO - what happens when int Id's are exhausted?

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2012

AO ID are integers, as shown.

Out of curiosity, what happens to AO if you exhaust its postive ID range of 2,147,483,647, does it rollover and start using negatives or does the sky fall? Sure I could look at the source, but just maybe others might find this interesting?

2 answers

1 accepted

3 votes
Answer accepted
Samuel Le Berrigaud
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2012

The short answer is: I don't know. Good question. Maybe we could warn or do some check of some sort… What were you thinking should happen?

Do you have a concrete use case where you fear you might reach this limit?

In any case, nothing prevents you from using Long for you entity IDs. For example I know the GreenHopper developers defined their own Entity parent class as:

public interface Entity extends RawEntity<Long>
{
	@AutoIncrement
	@NotNull
	@PrimaryKey("ID")
	public long getID();
}

This should give you some room up to 9,223,372,036,854,775,807 ;-)

Note that AO is capable of migrating int IDs to long IDs if necessary, however I would advise choosing the type that will suit your expected usage as soon as possible. Of course.

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2012

Hmm, yes, that seems like a good thing, thanks for the pointer. Given JIRA uses long types, wouldnt it be consistent to default AO objects to use them for ID's by default too, ints just stand out...

Samuel Le Berrigaud
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2012

Well, int has been the default ID type for AO for a little while, so I didn't want to change that. Maybe I should have…

0 votes
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2012

Kudos to the AO developers if they have code that specifically addresses this situation. Anyway, it's likely that the database would die long before IDs are exhausted ;)

Paul S
Contributor
April 18, 2018

That is irrelevant if the codebase is incompatible because it uses int instead of long!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events