Skip to content

Commit

Permalink
Readonly transactional annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ianibo committed Jul 26, 2022
1 parent a8cb523 commit b75cdd3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.k_int.okapi.OkapiTenantAwareController

import grails.gorm.multitenancy.CurrentTenant
import groovy.util.logging.Slf4j
import grails.gorm.transactions.Transactional


/**
Expand All @@ -18,6 +19,16 @@ class EntitlementController extends OkapiTenantAwareController<EntitlementContro
EntitlementController() {
super(Entitlement)
}

@Transactional(readOnly=true)
def index(Integer max) {
super.index(max)
}

@Transactional(readOnly=true)
def show() {
super.show()
}

def external() {
Entitlement ent = new Entitlement ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ class SubscriptionAgreementController extends OkapiTenantAwareController<Subscri
super(SubscriptionAgreement)
}


@Transactional(readOnly=true)
def index(Integer max) {
super.index(max)
}

@Transactional(readOnly=true)
def show() {
super.show()
}

@Transactional(readOnly=true)
def publicLookup () {
final List<String> referenceIds = params.list('referenceId')
final List<String> resourceIds = params.list('resourceId')
Expand Down Expand Up @@ -216,6 +226,7 @@ class SubscriptionAgreementController extends OkapiTenantAwareController<Subscri
})
}

@Transactional(readOnly=true)
def resources () {

final String subscriptionAgreementId = params.get("subscriptionAgreementId")
Expand Down Expand Up @@ -284,6 +295,7 @@ class SubscriptionAgreementController extends OkapiTenantAwareController<Subscri
}
}

@Transactional(readOnly=true)
def currentResources () {

final String subscriptionAgreementId = params.get("subscriptionAgreementId")
Expand Down Expand Up @@ -383,6 +395,7 @@ class SubscriptionAgreementController extends OkapiTenantAwareController<Subscri
}
}

@Transactional(readOnly=true)
def droppedResources () {

final String subscriptionAgreementId = params.get("subscriptionAgreementId")
Expand Down Expand Up @@ -450,6 +463,7 @@ class SubscriptionAgreementController extends OkapiTenantAwareController<Subscri
}
}

@Transactional(readOnly=true)
def futureResources () {

final String subscriptionAgreementId = params.get("subscriptionAgreementId")
Expand Down Expand Up @@ -575,6 +589,7 @@ class SubscriptionAgreementController extends OkapiTenantAwareController<Subscri
respond ([statusCode: 404])
}

@Transactional(readOnly=true)
def export () {
final String subscriptionAgreementId = params.get("subscriptionAgreementId")
if (subscriptionAgreementId) {
Expand Down

0 comments on commit b75cdd3

Please sign in to comment.