What is the best way to use transactional active objects?

I see the following alternatives and do not know which one is better than the other.

a) Keep @ComponentImport annotation on your classes where you require ActiveObjects like this:

private ActiveObjects activeObjects;

And in combination with this add the following to the Spring configuration:

<bean class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
    <constructor-arg ref="activeObjects"/>

This solution is based on the ActiveObjects component being available under the name activeObjects or else this will not work.

b) Remove all @ComponentImport annotations from your code and require Spring to resolve ActiveObjects with OSGi so that there is only one instance available to your classes.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"

    <osgi:reference id="activeObjects">

    <bean id="tx-processor" class="com.atlassian.activeobjects.external.TransactionalAnnotationProcessor">
        <constructor-arg ref="activeObjects"/>



Can anybody tell me which of those two alternative is the better way or whether there is another solution to favor over those two?

1 Like

Have you ever thought of using Atlassian Spring Scanner.

Using above has made my life much more simple.

As you can see from the configuration in my question I am already using Atlassian Spring Scanner but struggling with the best way to inject the Active Objects instance into the Bean Post Processor to handle @Transaction annotations on my service interfaces.

So your answer does not help me to choose from the alternatives I have listed in my question.

@Transaction annotation is not implemented in JIRA. The only way I know is to create a custom transaction object.

1 Like