Я использую Spring boot version 1.5.4.RELEASE
У меня есть объект, определенный как ниже
@Setter
@Getter
@ToString
@NoArgsConstructor
@Entity
@Table(name = "EVT")
public class EventData {
@GenericGenerator(
name = "eventSequenceGenerator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {@Parameter(name = "sequence_name", value = "SEQ1_EVT")})
@Id
@GeneratedValue(generator = "eventSequenceGenerator")
@Column(name = "EVT_ID")
private BigInteger evtId;
}
Я использую DB2 в качестве базы данных. Мой конфиг источника данных из application.yml
datasource:
url: <my_url>
## Connection pool
tomcat:
db-properties:
clientProgramName: event
initial-size: 0
max-active: 150
max-idle: 10
min-idle: 0
max-wait: 10000
test-on-borrow: true
test-on-return: false
validation-query: SELECT 1 FROM SYSIBM.SYSDUMMY1
validation-query-timeout: 300
remove-abandoned: true
remove-abandoned-timeout: 360
default-transaction-isolation: 1
min-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 1200000
Время от времени я получаю сообщение об ошибке ниже. В день примерно 5 раз.
- Я пропустил какую-либо конфигурацию в application.yml?
- Нужно ли мне увеличивать размер пула?
Как узнать, какой диалект установить снизу в application.yml. Моя версия DB2: DB2 v10.5.0.9
- DB2Dialect
- DB2390Dialect
- DB2400Dialect
Exception:
<unresolved>
Message:
<unresolved>
Stacktrace:
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(<unresolved>:203)
org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(<unresolved>:68)
<unresolved>.<unresolved>(<unresolved>:47)
<unresolved>.<unresolved>(<unresolved>:242)
org.hibernate.id.enhanced.SequenceStructure$1.getNextValue(<unresolved>:96)
org.hibernate.id.enhanced.NoopOptimizer.generate(<unresolved>:40)
org.hibernate.id.enhanced.SequenceStyleGenerator.generate(<unresolved>:412)
org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:67)
org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189)
org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132)
org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58)
org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:775)
org.hibernate.internal.SessionImpl.persist(SessionImpl.java:748)
org.hibernate.internal.SessionImpl.persist(SessionImpl.java:753)
org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1146)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:347)
com.sun.proxy.$Proxy.persist
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298)
com.sun.proxy.$Proxy.persist
org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:508)
org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:542)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
Редактировать 1
Exception:
org.springframework.web.util.NestedServletException
Message:
<unresolved>
И
Exception:
org.springframework.beans.NotReadablePropertyException
Message:
<unresolved>
Stacktrace:
org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyValue(AbstractNestablePropertyAccessor.java:633)
org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyValue(AbstractNestablePropertyAccessor.java:624)
org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyType(AbstractNestablePropertyAccessor.java:505)
org.springframework.boot.bind.RelaxedDataBinder.resolvePropertyName(RelaxedDataBinder.java:420)
org.springframework.boot.bind.RelaxedDataBinder.getActualPropertyName(RelaxedDataBinder.java:384)
org.springframework.boot.bind.RelaxedDataBinder.initializePath(RelaxedDataBinder.java:273)
org.springframework.boot.bind.RelaxedDataBinder.normalizePath(RelaxedDataBinder.java:259)
org.springframework.boot.bind.RelaxedDataBinder.modifyProperty(RelaxedDataBinder.java:240)
org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:155)
org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
org.springframework.validation.DataBinder.bind(DataBinder.java:740)
org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(<unresolved>:272)
org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(<unresolved>:240)
org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(<unresolved>:329)
org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(<unresolved>:296)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(<unresolved>:230)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(<unresolved>:208)
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
org.springframework.beans.factory.support.ConstructorResolver.resolvePreparedArguments(ConstructorResolver.java:785)
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:128)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1083)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(<unresolved>:230)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)