How does Active Objects know the next primary key value?

I'm moving data from one JIRA to another and I know about the sequence_value_item table that contains the next primary ids to use for each kind of table and its data.

I'm looking for something similar in Active Objects. For example when you add a new column to a board, the info is recorded in AO_60DB71_COLUMN. But how did AO know what primary key value to use - did it keep the last used value somewhere, or did it dynamically find the highest primary key for each table at startup?

5 answers

1 accepted

0 vote

I have added more info to about this.

Basically, it's pretty easy in MySQL 5.6 since you can override autoincrement with an INSERT, but it's harder in Oracle 11g. With Oracle you have to disable a trigger, hack a sequence to increment it, reenable the trigger. Apparently Oracle 12 has autoincrement built in.

It is using DB feature for auto-increment keys


public interface Entity extends RawEntity<Integer>
	public int getID();

So, by default, all your entities are using this scheme

But simple google search shows that you can use some custom ones, as well

However, I suggest to think twice, before using this approach and the main reason I see is that it can get pretty complex when you consider backup and restore functionality and your "custom functionality"

0 vote

Perhaps the id field once known is just autoincremented by the database?

As SQL developer I can assume that usually every database provide next id. There are two major options: incremental and random id. It is commonly is configured into Database settings.

That's not how JIRA does it. It stores the next id in the sequence_value_item table.

0 vote

ActiveObjects uses the AUTOINCREMENT column attribute for the primary key (id) column in MySQL. In Oracle 11 it uses a sequence and a trigger to do the same thing

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted Thursday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

189 views 12 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot