Port Jira connect plugin's database to server plugin

I am porting existing JIRA connect plugin to server architecture. In connect, i was using mysql database with jdbc connection.

1> Can i directly use connect's mysql database in server plugin?

 2> If not, then i am fine with Active Object too. But i am not getting exact detailed documentation on active objects. (How to create combo unique key, Joins between tables). 

2 answers

1 accepted

This widget could not be displayed.

Server plugins should use Active Objects to store data - this is the recommended approach. If for some reason AO does not work for you you can always connect to other database, but this makes things a lot more complicated - for example:

  • You should bundle the appropriate JDBC connector
  • You need a UI for providing db connection settings - host, port, user, etc..
  • Who will create the database for your add-on ?
  • etc...

Here're some useful guides on Active Objects

https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects

https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects/getting-started-with-active-objects

And about the JOINS

https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects/developing-your-plugin-with-active-objects/the-active-objects-library/manytomany-relationship

https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects/developing-your-plugin-with-active-objects/the-active-objects-library/onetomany-relationship

 

@Boris Georgiev Thanks Boris. Actually i checked all above links but not getting any good example for how to add combo unique key, On DELETE cascade on foreign key, add procedures and triggers in active objects.

 

  • You can't create multi column keys - https://ecosystem.atlassian.net/browse/AO-96
  • AO does not support procedures and triggers - you might need to re-design your application and move this logic into the Java persistence layer
  • Also I don;t think there is a CASCADE delete, so you should also handle that in Java

 

@Boris Georgiev [Botron] : Thanks Boris. I think yes i need to do everything using JAVA now. sad  I wanted to reuse connect plugin code as much as i can in server plugin.

This widget could not be displayed.

Yes, as long as it's not the JIRA database - you must never write to a JIRA database directly.

@Nic Brough [Adaptavist] SO active objects is the only option in server plugin for Database. Right?

 

You can't use the database in Connect either, so I'm not sure what you're doing.  I'd assumed you were reading an external database and your addon will continue to do that.

 

@Nic Brough [Adaptavist] : yes you are right. In case of connect i am using external database. But in server plugin, i don't want to use external database. I want to port that external database in JIRA itself through active objects.

Ah, good, I did understand it correctly then!  Thanks!  Boris has beaten me to all the links I'd recommend.

The only thing I'd add is that you should stop thinking about doing things at a database level (forget triggers and keys etc) - you need to use the functions for handling AO as documented in Boris' links.

@Nic Brough [Adaptavist] Thanks Nic. Its clear now.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

118 views 1 2
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