Skip to content

Commit

Permalink
fixed wrong local rollbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Jan 31, 2022
1 parent 03ccde7 commit ba0a1a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package micronaut.grails.example

import com.agorapulse.micronaut.grails.domain.Manager
import com.agorapulse.micronaut.grails.example.DirectlyInjected
import com.agorapulse.micronaut.grails.example.InjectedUsingBridge
import com.agorapulse.micronaut.grails.example.InjectedUsingBridgeWithDifferentName
Expand Down Expand Up @@ -75,10 +76,12 @@ class TestController {
}

def managers() {
render([
someDirectlyInjected: someDirectlyInjected?.managerCount,
injectedUsingBridge : injectedUsingBridge?.managerCount,
] as JSON)
render(Manager.withNewSession {
[
someDirectlyInjected: someDirectlyInjected?.managerCount,
injectedUsingBridge : injectedUsingBridge?.managerCount,
]
} as JSON)
}

def profiles() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import org.springframework.core.env.ConfigurableEnvironment
import org.springframework.core.env.PropertyResolver
import org.springframework.core.io.ResourceLoader

import io.micronaut.core.annotation.NonNull

class DefaultApplication extends GrailsAutoConfiguration {

static ConfigurableApplicationContext context
Expand Down Expand Up @@ -174,7 +172,7 @@ class DefaultApplication extends GrailsAutoConfiguration {
def micronautContext = new DefaultApplicationContext(micronautConfiguration) {

@Override
protected DefaultEnvironment createEnvironment(@NonNull ApplicationContextConfiguration configuration) {
protected DefaultEnvironment createEnvironment(ApplicationContextConfiguration configuration) {
return configureMicronautEnvironment.call(super.createEnvironment(configuration)) as DefaultEnvironment
}
}
Expand Down

0 comments on commit ba0a1a1

Please sign in to comment.