This repository was archived by the owner on Mar 10, 2025. It is now read-only.
File tree 2 files changed +3
-17
lines changed
core/src/main/groovy/org/grails/gorm/graphql/fetcher
examples/spring-boot-app/src/main/groovy/com/example/demo
2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -119,25 +119,10 @@ abstract class DefaultGormDataFetcher<T> implements DataFetcher<T> {
119
119
datastore = this . datastore
120
120
}
121
121
122
- // To support older versions of GORM
123
- try {
124
- Method getTransactionManager = datastore. class. getMethod(' getTransactionManager' , (Class<?> []) null )
125
- PlatformTransactionManager transactionManager = (PlatformTransactionManager )getTransactionManager. invoke(datastore)
126
- CustomizableRollbackTransactionAttribute transactionAttribute = new CustomizableRollbackTransactionAttribute ()
127
- transactionAttribute. setReadOnly(readOnly)
128
- new GrailsTransactionTemplate (transactionManager, transactionAttribute). execute(closure)
129
- } catch (NoSuchMethodException | SecurityException e) {
130
- log. error(' Unable to find a transaction manager for datastore {}' , datastore. class. name)
131
- null
132
- }
133
-
134
- // Supports 6.1.x+ only
135
- /*
136
- TransactionService txService = (TransactionService)datastore.getService((Class<?>)TransactionService)
122
+ TransactionService txService = datastore. getService(TransactionService )
137
123
CustomizableRollbackTransactionAttribute transactionAttribute = new CustomizableRollbackTransactionAttribute ()
138
124
transactionAttribute. setReadOnly(readOnly)
139
125
txService. withTransaction(transactionAttribute, closure)
140
- */
141
126
}
142
127
143
128
abstract T get (DataFetchingEnvironment environment )
Original file line number Diff line number Diff line change @@ -8,10 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired
8
8
import org.springframework.boot.SpringApplication
9
9
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
10
10
import org.springframework.boot.autoconfigure.SpringBootApplication
11
+ import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
11
12
import org.springframework.context.annotation.Bean
12
13
import org.springframework.context.annotation.ComponentScan
13
14
14
- @EnableAutoConfiguration
15
+ @EnableAutoConfiguration ( exclude = [ HibernateJpaAutoConfiguration ])
15
16
@ComponentScan
16
17
@CompileStatic
17
18
@SpringBootApplication
You can’t perform that action at this time.
0 commit comments